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 types of index data structures can you have in java?
What is meant by class and object in java?
What is the difference between static synchronize() metod and synchronize() method?
Suppose there is an Online shopping cart application having different objects like Cart, SelectionItem, Billing, COnfiguration, Authentication, Authorization, PersonalDetails etc. Out of this which one can be made a singleton pattern and why?
Describe OOP in java?
What is an class?
What does system out println () do?
Can we instantiate interface in java?
Static Variable can referred in non-static method?
How to create com object in Java?
Why is Java a platform independent language?
What is method in java with example?