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
What do you mean by thread safe?
What are the benefits of operations in java?
Can a constructor be private and how are this() and super() method used with constructor?
What is methods in java?
Can a static class have a constructor?
Can memory leak happen java?
What is connection class in java?
How do I run java on windows?
Difference between serialization and deserialization in java?
What are the steps in the jdbc connection?
What is the main use of java?
How do you calculate roots in java?
What is final modifier?
What are the loops in java?
What is member in java?