Can a class be a super class and a sub-class at the same time? Give example.



Can a class be a super class and a sub-class at the same time? Give example...

Answer / 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

More Core Java Interview Questions

What is __ init __ functions?

0 Answers  


How can you reverse a string?

8 Answers  


What is the difference between arraylist and hashset in java?

0 Answers  


Why is it important to initialize a variable?

0 Answers  


When a byte datatype is used?

0 Answers  






What are the three parts of a lambda expression?

0 Answers  


If goto and const is reserve words than why it is not work in java?

0 Answers  


Where is core java used?

0 Answers  


What is http client in java?

0 Answers  


Can we execute a program without main() method?

0 Answers  


What are streams?

0 Answers  


What are autoboxing and unboxing? When does it occur?

0 Answers  


Categories