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

What is a conditional equation?

978


Write a program to reverse array in place?

1022


How do you check if a character in a string is a digit or letter?

1015


How do you use find and replace?

904


What is the static block?

1011


What is garbage collection? What is the process that is responsible for doing that in java?

1066


Can you create an object of an abstract class?

956


How do you know if a value is nan?

1019


What are memory tables?

1059


What is the final keyword?

944


Describe the term diamond problem.

988


What is the += operator called?

1002


What is the size of int in 64-bit jvm?

1021


Can a class have multiple subclasses?

1059


What do you understand by java?

928