Can a class be a super class and a sub-class at the same time? Give example.



Can a class be a super class and a sub-class at the same time? Give example...

Answer / hrindows@gmail.com

If there is a hierarchy of inheritance used, a class can be a super class for another class and a sub-class for another one at the same time.
In the example below, continent class is sub-class of world class and it’s super class of country class.
public class world {
..........
}
public class continenet extends world {
............
}
public class country extends continent {
......................
}

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Core Java Interview Questions

What is array length?

0 Answers  


What does \ mean in regex?

0 Answers  


What is string :: npos?

0 Answers  


When is the finalize() called? What is the purpose of finalization?

0 Answers  


what is enumset?

0 Answers  






What is the difference between public, private, protected, and friend access?

0 Answers   Amazon,


What is singletonlist in java?

0 Answers  


in a constructor what happen if u call super and this in the same class? i know that it is not possible to call both in the same one? if we call what will happen?

10 Answers   ITC Infotech,


what is default layout of JFrame class?

6 Answers  


what is net based application and its types

1 Answers  


What is object of class in java?

0 Answers  


What is unsigned char?

0 Answers  


Categories