Advantages of Inheritance in java.

Answer Posted / kureshi salman

Inheritance means deriving a child class from a parent class
(i.e.existing class).
Use of inheritance iin java is we can reuse of a code.
For Ex.
class a
{
//variables.....
//methods.......
}
class b extends a
{
//variable of class a....
//methods of class a.....
//also
//variables and methods of class b
}
it means that we can inherit the class and features of
existing class in a new class.

Is This Answer Correct ?    29 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many types of constructors are used in java?

534


How do you classify Dialog Box?

645


what is the constructor and how many types of constructors are used in java?

531


Is Constructor possible in abstract class in java ?

582


How you can force the garbage collection?

533






Difference between throw and throws?

616


How do you use spaces in java?

520


What is the syntax and characteristics of a lambda expression? Explain

537


What is the difference between menuitem and checkboxmenu item?

771


Difference between object instantiation and construction ?

578


What is the difference between abstract classes and interfaces?

505


What is meant by inheritance and what are its advantages?

573


What do you mean by light weight and heavy weight components?

549


What is method with example?

577


What is data type in java?

483