Note 1

Take Note:

Take a note while surfing.





Note With Ink

Give your Note a Colorful Tag.




Easy to Access

Stay on same information and in Sync wherever you are.

Note 2

Take Note:

Organize your information,It may take Shape.





Think With Ink

Differ your Content by Color.




Easy to Access

Easy to pull up your content from anywhere anytime.

Note 3

Take Note:

Don't Let information to miss,Because it take shape





Note With Ink

Simple an Easy Way to take a note.




Easy to Access

Get the same in next visit.


Please wait...

Technical Discussion :: Java

2. What is Inheritance?

Answer:

Inheritance means, we use the methods or function or other public members of the parent class by child class. So to do this we have to extend the the parent class through it child class.
For Ex:- Amitabh bacchan's fames inherited by his child Abhishek.

Program Ex:-

class A{
print(){
System.out.println("HELLLO ");
}}

class B extends class A{
public static void main(String... args){
A pr=new A();
pr.print();
}}

Things to remember:---
* Every class in java inherited by its parent class Object which is in the package:- java.lang.Object when the class is not extended by any child class only.
* Java does not support "Multiple Inheritance" except in the case of Interface Concept.
Because one class cannot extend more than one class but Interface able to extend more than one.

Asked In ::  Tech Mahindra   iGate   Syntel Inc.   Accenture   AT&T  

Post Your Answer Here:


Post Your Reply Here:

Alert me
q4i-reply-your-answer

Report Error

Please Login First Click Here