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
How will you calculate the depth of a binary tree if the tree contains 15 nodes?
What is %d in printf?
What is the function of static in java?
What is a flag value?
What is a java developer salary?
Make a data structure and implement an algorithm to print all the files in a directory. (The root directory can have sub-directories too.)
Explain about java sdk?
How is a structure different from array ?
What is the primitive type short?
What does java se mean?
Can java object be locked down for exclusive use by a given thread?
What is substring 1 in java?
What is Java Annotations?
Why vector is used in java?
Does java support function overloading, pointers, structures, unions or linked lists?