Java Programming Multiple Choice Questions - Inheritance

This section focuses on the "Inheritance" in Java programming. These Multiple Choice Questions (MCQ) should be practiced to improve the Java programming skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements and other competitive examinations.

1. ____________ can be defined as the process where one class acquires the properties (methods and fields) of another.

A. Overriding
B. Inheritance
C. Polymorphism
D. Abstraction

View Answer


2. The class which inherits the properties of other is known as ________

A. superclass
B. parent class
C. subclass
D. None of the above

View Answer


3. Subclass also known as ?

A. derived class
B. child class
C. base class
D. Both A and B

View Answer


4. The class whose properties are inherited is known as superclass.

A. TRUE
B. FALSE
C. Can be true or false
D. Can not say

View Answer


5. ___________ is the keyword used to inherit the properties of a class.

A. inherit
B. poly
C. extends
D. super

View Answer


6. The super keyword is similar to _________ keyword.

A. construct
B. this
C. class
D. extends

View Answer


7. A class member declared protected becomes a member of subclass of which type?

A. public member
B. protected member
C. static member
D. private member

View Answer


8. Which of these is correct way of inheriting class A by class B?

A. class B + class A {}
B. class B inherits class A {}
C. class B extends A {}
D. class B extends class A {}

View Answer


9. ______ is a way of saying: This object is a type of that object.

A. IS-A
B. HAS-A
C. ARE-A
D. HAD-A

View Answer


10. A subclass inherits all the members (fields, methods, and nested classes) from its superclass

A. Yes
B. NO
C. Can be yes or no
D. Can not say

View Answer





Discussion


* You must be logged in to add comment.