Programming - Inheritance
You Are Here :: Home > JAVA > Inheritance - General Questions
13. |
The first use of keyword __________________ is to access the hidden data variables of the super class hidden by the sub class.
|
A. |
this |
B.
|
extends |
C.
|
super
|
D.
|
get
|
|
Answer: Option C
Explanation:
|
14. |
What is the difference between superclass & subclass?
|
A. |
A super class is a class that is inherited whereas subclass is a class that does the inheriting. |
B.
|
A parent class is a class that is inherited whereas subclass is a class that does the inheriting. |
C.
|
A child class is a class that is inherited whereas subclass is a class that does the inheriting.
|
D.
|
A parent class is a class that is inherited whereas super is a class that does the inheriting.
|
|
Answer: Option A
Explanation:
|
15. |
Which keyword is used to inherit a class?
|
A. |
this |
B.
|
extends |
C.
|
super
|
D.
|
get
|
|
Answer: Option B
Explanation:
|
16. |
Subclasses methods can access superclass members/ attributes at all times?
|
A. |
FALSE |
B.
|
TRUE |
C.
|
Can't Say
|
D.
|
None
|
|
Answer: Option A
Explanation:
|
17. |
When can subclasses not access superclass members?
|
A. |
When superclass is declared as private. |
B.
|
When superclass is declared as public. |
C.
|
When childclass is declared as private.
|
D.
|
When child class is declared as public.
|
|
Answer: Option A
Explanation:
|
18. |
Which class does begin Java class hierarchy?
|
A. |
Object class |
B.
|
Class |
C.
|
Variables
|
D.
|
Methods
|
|
Answer: Option A
Explanation:
|
« prev
next »