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 meant by singleton class?

781


Write a program in java to find the maximum and minimum value node from a circular linked list.

751


What do you mean by an object in java?

852


What are new features introduced with java 8 ?

728


What is the locale class in java programming?

730


What are disadvantages of java?

731


Which methods are used during serialization and deserialization process?

725


What is java in detail?

811


Implement a stack with push (), pop() and min() in O(1) time.

802


what is meant by HQL?

818


What is mnemonic in assembly language?

798


What’s the difference between applets and standalone program?

733


What does flag mean in java?

722


What is the relationship between clipping and repainting under awt?

829


Explain the meaning of java applet.

817