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 overloading and overriding?
Are generics important java?
Why call by value prevents parameter value change?
transaction attributes ?
What checkbox method allows you to tell if a checkbox is checked?
Why is java called the platform independent programming language?
How many characters is 2 bytes?
Can we overload final method in java?
What is the difference between Trusted and Untrusted Applet ?
Is intellij better than eclipse?
What are the two major components of JDBC?
Is java util list serializable?