Solved

Consider the Classes Shown Below: Public Class Parent

Question 35

Multiple Choice

Consider the classes shown below: public class Parent
{
Public void doSomething() {/* Implementation not shown */}
}
Public class Child extends Parent
{
Public void doAnotherThing() {/* Implementation not shown */}
}
Which lines in the following code will compile without error?
Parent kid = new Child() ;
Kid) doSomething() ; // line 1
Kid) doAnotherThing() ; // line 2


A) Line 1 only
B) Line 2 only
C) Lines 1 and 2
D) Neither line will compile without error

Correct Answer:

verifed

Verified

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

Related Questions