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 are the disadvantages of using inner classes?
what is the use of pojo (plain old java objects)? how it is interact with crystal reports? pls urgent
What is the difference between serial and throughput garbage collector?
What is an empty list in java?
What is the difference between the direct buffer and non-direct buffer in java?
What do you mean by compiler?
What are register variables what are the advantages?
Write a function to print Fibonacci series and Tribonacci series?
Difference between nested and inner classes ?
How to make a read-only class in java?
How do you find the absolute value?
What is a pattern what is an anti pattern?
What is multi level inheritance in java?
How many bits is size_t?
What is the technique adopted to create an immutable class?