What is inheritance in Java?
A. Inheritance is a way to define a new class based on an existing class.
B. Inheritance is a way to create a new instance of a class.
C. Inheritance is a way to restrict access to a method or variable.
D. None of the above.
Answer:A
What is inheritance in Java?
A. Inheritance is a way to define a new class based on an existing class. B. Inheritance is a way to create a new instance of a class. C. Inheritance is a way to restrict access to a method or variable. D. None of the above.