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

Which are the two subclasses under exception class?

1166


How do I type unicode?

1027


What does the three dot emoji mean?

1198


How to find the given number is a prime number or not by getting input from the user

1154


why an outer class cannot be declared as private?

4378


What is java util concurrentmodificationexception?

957


What is the size of an array?

1079


What state does a thread enter when it terminates its processing in java programming?

1087


Which graphs are functions?

1013


What are peerless components?

1140


What is maximum size of arraylist in java?

1086


What's the access scope of protected access specifier?

1096


Is final static java?

1071


Which class contains a method: cloneable or object?

1095


Is java still relevant?

1025