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

Tell me are there implementations for sorting and searching in the java libarary?

1017


Are maps ordered java?

943


What is overriding in java?

1057


Why lambda expression is used in java?

1044


Which is better stringbuilder or stringbuffer?

922


Explain different forms of polymorphism?

1137


String and stringbuffer both represent string objects. Can we compare string and stringbuffer in java?

956


What is identifier with example?

1041


How will you initialize an Applet?

1134


What do you understand by the term polymorphism?

1070


Is java an open source?

965


Is java a virus?

943


Which keyword specify that a variable is effectively final ?

976


What is the base class of all exception classes?

1056


How do you identify independent and dependent variables?

998