Developer community
0 votes
163 views
asked by Guru (39.1k points) 10 22 34
reshown by | 163 views

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 Guru (27.1k points) 32 50 97
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 Guru (39.1k points) 10 22 34

Related questions

0 votes
1 answer
asked by john Guru (27.1k points) 32 50 97 | 16 views
0 votes
1 answer
asked by john Guru (27.1k points) 32 50 97 | 16 views
0 votes
1 answer
asked by rajesh Guru (39.1k points) 10 22 34 | 8 views
0 votes
2 answers
asked by smith Geek (15.3k points) 17 40 60 | 23 views
0 votes
1 answer
asked by sunny Expert (11.4k points) 14 22 29 | 44 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

Categories


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

3.8k questions

4k answers

117 comments

10.7k users

3,751 questions
4,046 answers
117 comments
10,709 users