Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Does Java support multiple Inheritance?

Answer Posted / debapriya patra

Java does not support multiple inheritance.Why?

If anybody ask u why java does not support multiple
inveritance then answer is:"Whenever we create an instance
of a child class and we extend more then one class like
C++, then if these two classes contain same variable then
which will print if we try to print the variable."

Example:
class a
{
int i = 10;
}
class b
{
int i = 10;
}

class c extends a,b
{
public static void main(String[] args)
{
c c1 = new c();
System.out.printn(c1.i);//Here an ambiguous situation
will occur
}
}

Is This Answer Correct ?    29 Yes 14 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How much is a java license?

868


How do listeners work?

979


What does it mean that a method or field is “static”?

920


Write a program in java to create a doubly linked list containing n nodes.

906


What is difference between core java and java ee?

848


What is multi-catch block in java?

1016


What is a local class in java?

985


What do you know about the garbage collector?

1046


How can we create an immutable class in java?

1016


What are the different types of data structures in java?

938


What is classpath?

954


How is a variable stored in memory?

932


How to implement an arraylist in java?

1035


What programs use java?

880


Are variables stored in ram?

956