Solved

Consider the Classes Shown Below: Public Class Parent

Question 52

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

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