java 4) If a subclass constructor does not explicitly call a superclass construc
ID: 3834509 • Letter: J
Question
java
4)
If a subclass constructor does not explicitly call a superclass constructor,
_
A)
The superclass fields will be set to the default values for their data types
B)
Java will automatically call the superclass's default constructor immediately after the code in the subclass's constructor executes
C)
It must include the code necessary to initialize the superclass fields
D)
Java will automatically call the superclass's default constructor just before the code in the subclass's constructor executes
5)
In the following statement, which is the superclass?
public class ClassA extends ClassB implements ClassC
_
A)
ClassA
B)
ClassB
C)
ClassC
D)
Cannot tell
6)
When one object is a specialized version of another object, there is this type of relationship between them.
_
A)
"contains a"
B)
Direct
C)
"is a"
D)
"has a"
7)
A subclass class can directly access
_
A)
Only protected and private members of the superclass class
B)
All members of the superclass class
C)
Only public and private members of the superclass class
D)
Only public and protected members of the superclass class
Explanation / Answer
4. ans
opt: D. Java will automatically call the superclass's default constructor immediately after the code in the subclass's constructor execute
calling the super class constructor.
5. ans: opt B class B
6. opt c is "a"
7. opt d:
Only public and protected members of the superclass class
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.