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

How multipleInheritance is possible in java?

Answer Posted / pradeep panwar

Hi all, This is Pradeep...
I am confused by the java statement that "By using
interface we can achieve multiple inheritance bcoz java
doesn't support Multiple inheritance".
Yes.Ok java doent support Multiple inheritance. Now we know
that inheritance means that "one object acquires the
property of another object".
So how can it is possible achieve Multiple inheritance by
interface.
Interface that contains just undefined methods like below
code.

interface Member1
{
public void eye();
public void nose();
public void mouth();
}
interface Member2 extends member1
{
public void neck();
public void hand();
public void stomach();
}
interface Member3 extends Member1,Member2
{
public void leg();
}

class Man implements Member3
{
public man()
{
Member3 ref=new Man();
}
// Here Implements all 7 methods.
}


/*
Is the above code defines multiple Inheitance?
undefined methods are eye,nose,mouth,neck,handand stomach
are fall in Interface Member3 .Yes. But Inheritance means
that one object acquires the property of another
object.Property means that code and data.
In here, there is no code just declarations of method which
is not to be a code .
So How can we say interface achieve multiple inheritance.
Please any one explain and clear my doubt with simple
example.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which package has light weight components?

932


What is the console in java?

1096


What is the meaning of variables in research?

978


What are different types of arrays?

954


What do you mean by data type?

973


What is the purpose of checked and unchecked exceptions in JAVA?

957


Is null a value?

970


What is default locale java?

1047


Can we use both this () and super () in a constructor?

967


Can we have any code between try and catch blocks?

931


What are "methods" and "fields"?

973


What is difference between core java and java ee?

851


Does java vector allow null?

897


What is "this" keyword in java? Explain

1052


What is meant by string is immutable?

1001