Solved

Consider the Classes Shown Below: Public Class Parent

Question 38

Multiple Choice

Consider the classes shown below: public class Parent
{
Public void doSomething() // method 1
{ /* Implementation not shown */ }
}
Public class Child extends Parent {
Public void doSomething(int n) // method 2
{ /* Implementation not shown */ }
Public void doSomething() // method 3
{ /* Implementation not shown */ }
}
If the variable kid is defined below, which version of the doSomething method can be called on the variable kid?
Parent kid = new Child() ;


A) Method 1 only
B) Methods 2 and 3 only
C) Methods 1 and 2 only
D) Methods 1, 2, and 3

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions