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
What is the purpose of javac exe?
When do we use hashset over treeset?
How many classes can any class inherit java?
What does it mean to flush a file?
How do you sort words in java?
How can we make a class singleton?
Can we extend singleton class?
What is use of super keyword?
Explain about oops concepts.
Explain jdk, jre and jvm?
when should you use stringbuilder class in a program?
How can we make string upper case or lower case?
Who is the owner of java?
What is OOP Language?
Can you call a method in a method?