adspace


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

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

Answer Posted / lakshminarayana

IN THE FIRST BLOCK CLASS IS EXTENDING CLASS B.HERE A IS SUB
CLASS OF CLASS B.
AGAIN CLASS B IS EXTENDING CLASS A WHICH IS A SUB CLASS OF
B.A SUB CLASS NEVER BECOME A SUPER CLASS FROM WHICH IT IS
EXTENDED. SO IN JAVA IT THROWS A EXCEPTIONS LIKE CYCLIC
INHERITANCE NOT POSSIBLE...



... I THINK IT WILL HELPFUL FOR U.

Is This Answer Correct ?    30 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to sort array in descending order in java?

999


Write a program to print count of empty strings in java 8?

1089


Is minecraft 1.15 out?

1047


Write a program to find the whether a number is an Armstrong number or not?

1103


What are the differences between heap and stack memory in java?

1148


What is an object in java and how is it created?

1144


What is the difference between equals() and == in java?

1044


What is java string pool?

1086


explain different ways of using thread? : Java thread

1087


What is parsing in java?

1046


Explain public static void main(string args[]) in java.

1081


What is a classloader in java?

1092


Differentiate between static and non-static methods in java.

1131


Realized?

2268


What do you mean by an interface in java?

1105