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 the use of list in java?
What is lazy programming?
How HashMap implemented in java? how it internally works when values are added or searched from hashMap?What is the difference betweenthe implementation of hashmap and Linked Hashmap?
How to overcome the exception object reference not set to an instance of object?
Does java support multiple inheritance or not?
What is meant by polymorphism?
What is a double vs float?
What is keyword and identifier?
diff between abstract methods and interfaces with programing (code) example?
What is inheritance?
5 Answers Accenture, Hexaware, Syntel,
How to find the given number is a prime number or not by getting input from the user
What are the 6 functions?