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 hasnext in java?

0 Answers  


What is jpa specification?

0 Answers  


How infinite loop is declared?

0 Answers  


What is singleton class in java and how can we make a class singleton?

0 Answers  


What is a layout manager and what are different types of layout managers available in java awt?

0 Answers  






What is a thin-client application?

5 Answers   Adobe,


Which number is denoted by leading 0x or 0x in java?

0 Answers  


Why do we need singleton class?

0 Answers  


What is the function of character?

0 Answers  


How are Java source code files named?

3 Answers  


diff. b/w JAVA and javascript...

3 Answers   NIIT,


whats string ?

10 Answers   HCL,


Categories