Can a class be a super class and a sub-class at the same time? Give example.
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 |
What is array length?
What does \ mean in regex?
What is string :: npos?
When is the finalize() called? What is the purpose of finalization?
what is enumset?
What is the difference between public, private, protected, and friend access?
What is singletonlist in java?
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?
what is default layout of JFrame class?
what is net based application and its types
What is object of class in java?
What is unsigned char?