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:

Verified
Correct Answer:
Verified
Q31: Which of the following statements about comparing
Q32: Consider the following code snippet of a
Q33: When declared as protected, data in an
Q36: Consider the following code snippet: public abstract
Q37: A class that represents a more specific
Q38: Consider the classes shown below: public class
Q39: Consider the classes shown below: public class
Q40: Consider the following code snippet: public class
Q45: You are creating a Motorcycle class which
Q51: All hamsters are rodents and all rodents