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
How can we pass argument to a function by reference instead of pass by value?
What is annotation in java?
Can java cast null?
What is the difference between stringbuffer and stringbuilder?
How do you check whether the list is empty or not in java?
What is lexicographically smallest string?
What is a protected void?
Which class is the superclass of all classes?
How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?
Can you sort a string in java?
Explain the scope of a variable.
What is the same as procedures?
What is meant by collection in java?
What is the purpose of void?
What is the difference between abstract classes and interfaces?