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 hasnext in java?
What is jpa specification?
How infinite loop is declared?
What is singleton class in java and how can we make a class singleton?
What is a layout manager and what are different types of layout managers available in java awt?
What is a thin-client application?
Which number is denoted by leading 0x or 0x in java?
Why do we need singleton class?
What is the function of character?
How are Java source code files named?
diff. b/w JAVA and javascript...
whats string ?