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

Does chrome use java?

706


Can you give few examples of final classes defined in java api?

774


How do you square a number in java?

763


How many types of flags are there?

722


What is the difference between multiple processes and multiple threads?

782


what is difference betweem home interface and remote interface?

2328


How many types of array are there?

730


When we serialize an object does the serialization mechanism saves its references too?

713


How do you make an arraylist empty in java?

675


What is the byte range?

787


What are selection structures?

728


How do you get length in java?

776


Why do we need singleton?

730


What do you understand by access specifiers in Java?

779


Explain what access modifiers can be used for variables?

793