Can a class be a super class and a sub-class at the same time? Give example.
Answer Posted / 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 View All Answers
Define the term string pool?
What is size () in java?
What are the characteristics of java?
How do you convert an int to a double in java?
Explain exception chaining in java?
What is navigable map in java?
What is lambda programming?
Why do we need wrapper classes?
When is update method called?
What is a substring of a string?
What is regex java?
How many bytes is a string java?
Can we have more than one package statement in the source file?
What is java basic concept?
What is the gregoriancalendar class in java programming?