Question

Explain the concept of inheritance in java by providing examples from the real life. You should...

Explain the concept of inheritance in java by providing examples from the real life. You should identify the Superclass and Subclasses in your example

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A super class called Human. Added some attributes and functions. Attributes such as eyes, ears, brain, legs. Functions such as walk, talk, think, sleep etc.

Inheritance : 2 sub classes - Man and Woman. They inherited the attributes and functions of class human. Also added some attributes and functions specific to these classes. For the man and the woman class, added attributes specific to their anatomy.Also added functions specific to these classes, for instance, the function "GiveBirthToNewHuman" to the woman class.

Super class -Human
sub class -Man and Woman

Add a comment
Know the answer?
Add Answer to:
Explain the concept of inheritance in java by providing examples from the real life. You should...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT