C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers


10,705 users

What is Inheritance?

0 votes
asked by rajesh Guru (39,140 points)
reshown by admin

2 Answers

0 votes
Inheritance is a mechanism in which one object acquires all the properties and behaviour of another object of another class. It represents IS-A relationship. It is used for Code Resusability and Method Overriding.
answered by john Guru (27,140 points)
0 votes
•             Inheritance is the process by which objects of one class acquire the properties of objects of another class.

•             A class that is inherited is called a superclass.

•             The class that does the inheriting is called a subclass.

•             Inheritance is done by using the keyword extends.

  The two most common reasons to use inheritance are:

o             To promote code reuse

o             To use polymorphism
answered by rajesh Guru (39,140 points)

Related questions

0 votes
1 answer 14 views
0 votes
1 answer 15 views
0 votes
1 answer 8 views
0 votes
2 answers 23 views
23 views asked by smith Geek (15,340 points)
0 votes
1 answer 41 views