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 |
A non-static inner class may have object instances that are associated with instances of the class’s outer class. A static inner class does not have any object instances.
Can a class have multiple subclasses?
Is string an object?
What variables are stored in stack?
Can an integer be a string?
How do I start learning java?
What is difference between path and classpath in java?
What is an array and a vector? How they different from each other?
how to use this key word in java programming?
whats the life cycle of jsp
what is deadlock? : Java thread
how to write a program for sending mails between client and server