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 difference between protected and private?
What is a JAR file?
Can you run the product development on all operating systems ?
using equals method overriding which objects are compared?i.e same class objects or other class objects?Explain me.
What are peerless components in java programming?
What is the use of toarray () in java?
How do you convert string to int in java?
What are assertions in java?
what is collatration?
Print Vertical traversal of a Binary Tree.
How to create two different thread class inside a main function?
What is the use of inner class?