explain the concept of inheritance with an example?
Answer Posted / kkr
Inheritance is the process of creating the classes from existing classes by using 'extends' key word.
It is like IS-A relationship between the classes.
eg : Parent and child relationship. we cal parent class as super class and child class will be subclass.i.e the subclass will have all the members of super class.
Adv : Reusability of the code.i.e productivity will be increase.
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
Define array. Tell me about 2-D array.
Which method cannot be overridden in java?
What kind of variables can a class consist?
What is array length in java?
Give us the name of the list layoutmanagers in java?
What is length in java?
What is a bufferedreader?
How transient variable is different from volatile variable?
Why java doesn’t support multiple inheritances?
Can we declare a static variable inside a method?
What are the types of inner classes (non-static nested class) used in java?
How does enum work in java?
Can we override singleton class?
What is contract between hashcode and equal method?
Tell me the latest versions in java related areas?