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

class a extends b
{
}
class b extends a
{
}

why java doesn't support cyclic pls explain me with example

Answer Posted / kaustav chatterjee

Every class in java by default extends the Object class and they have to cause java is almost an object oriented language.but if we take this scenario where class B extends class A and class A extends class B then as java don't support multiple inheritance or multiple super class then class A cannot extend the Object class and cannot be a Object type or subclass of Object class but by definition of JAVA every class is a subclass of Object class.Hence it's not supported by JAVA as it contradicts basic definition of JAVA.

but if we don't extending any class in class A then it by default extends Object class and class B by extending class A also extending Object class.so there is no problem.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

State the difference between creating string as new () and literal.

1014


What are advantages of exception handling in java?

974


What is the difference between math floor and math round?

973


What method is used to specify a container's layout in java programming?

1041


Can we modify the throws clause of the superclass method while overriding it in the subclass?

993


What the difference is between execute, execute Query, execute Update?

763


What is the difference between a vector & an array list?

1098


What is jagged array in java?

1001


Can we create our own daemon thread?

924


What is difference between class and object in java?

1017


how to open and edit XML file in Weblogic???

1928


Can a constructor have different name than a class name in java?

1082


Why can't we use static class instead of singleton?

884


What is xslt in java?

930


What do you mean by collectors in java 8?

883