Inheritance

Advertisements
Advertisements
Advertisements3
Advertisements4
Advertisements6
Advertisements66

1. In Java, inheritance allows a subclass to:

Ans. Override  or extend the methods and fields from the superclass.

2. To create a subclass in Java, you use the ___ keyword followed by the name of the superclass.

Ans. extends.

3. The superclass in Java is also known as the

Ans. Parent class.

4. Which keyword in Java is used to refer to the methods and fields of the superclass?

Ans. Super.

 
 
 
 

Author: Lakshmi Prasanna Ponnala

Completed M.Tech in Digital Electronics and Communication Systems.

Leave a Reply

error: Content is protected !!

Discover more from ece4uplp

Subscribe now to keep reading and get access to the full archive.

Continue reading