Solved

Consider the Classes Below, Declared in the Same File

Question 1

Multiple Choice

Consider the classes below, declared in the same file:
class A {
Int a;
Public A() {
A = 7;
}
}
Class B extends A {
Int b;
Public B() {
B = 8;
}
}
Which of the statements below is false?


A) Both variables a and b are instance variables.
B) After the constructor for class B executes, the variable a will have the value 7.
C) After the constructor for class B executes, the variable b will have the value 8.
D) A reference of type A can be treated as a reference of type B.

Correct Answer:

verifed

Verified

Related Questions

Unlock this Answer For Free Now!

View this answer and more for free by performing one of the following actions

qr-code

Scan the QR code to install the App and get 2 free unlocks

upload documents

Unlock quizzes for free by uploading documents