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...

Is java supports multiple inheritance? explain?

Answer Posted / krishna kumar g.

Java doesn't supports Multiple Inheritence.
Let see the example.
class A
{
void m1()
{
// some code
}
}
class B
{
void m1()
{
// some code
}
}
class C extends A,B
{
void m2()
{ }
public static void main(String[] args)
{
C c=new C();
c.m1();
}
}
If we want to call m1() by using class C object, then
which class method(m1()) will be called.It is unable to
find the which class method(m1()) will be called.
So multiple Inheritence is not posssible.

Is This Answer Correct ?    6 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we extend immutable class?

973


What is method overloading and method overriding?

1048


What is java and their uses?

1025


Can you have two constructors in java?

964


Explain the importance of throwable class and its methods?

1026


What is the base class of all exception classes in java?

1049


What are the different conditional statements?

981


What do you mean by inner class in java? Explain

1057


How do you compare arrays in java?

943


What is the synonym of string?

1084


can rmi and corba based applications interact ?

1071


Differences between C and Java?

1182


What do you understand by an io stream?

1039


How does hashset work in java?

1107


Can I import same package/class twice?

947