Developer community
0 votes
177 views
asked by Guru (39.1k points) 10 23 38
reshown by | 177 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) 35 52 112
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 23 38

Related questions

0 votes
1 answer
asked by john Guru (27.1k points) 35 52 112 | 21 views
0 votes
1 answer
asked by john Guru (27.1k points) 35 52 112 | 16 views
0 votes
1 answer
asked by rajesh Guru (39.1k points) 10 23 38 | 9 views
0 votes
2 answers
asked by smith Geek (15.3k points) 18 43 68 | 25 views
0 votes
1 answer
asked by sunny Expert (11.4k points) 16 23 32 | 54 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,754 questions
4,046 answers
117 comments
10,709 users