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?
Child kid = new Child() ;
A) Methods 1 and 2 only
B) Method 2 only
C) Methods 2 and 3 only
D) Methods 1, 2, and 3
Correct Answer:
Verified
Q43: Consider the following code snippet: public class
Q44: If a subclass uses the same method
Q45: Consider the following code snippet: public class
Q46: If a subclass defines the same method
Q47: Consider the following code snippet: public class
Q49: Consider the following code snippet: public class
Q50: If a subclass contains a method with
Q52: Consider the classes shown below: public class
Q53: Consider the following code snippet: public class
Q54: Consider the following code snippet: public class
Unlock this Answer For Free Now!
View this answer and more for free by performing one of the following actions
Scan the QR code to install the App and get 2 free unlocks
Unlock quizzes for free by uploading documents