Question 26 / 35:  class Type {

public Object getTypeName(){

return "Type";

}

}

class SubType extends Type {

public String getTypeName(){//line 8

return "SubType";

}

}

public class Tester {

public static void main(String[] args) {

Type first = new SubType(); //line 16

System.out.println(first.getTypeName()); //line 17

}

}

What modification is necessary to produce the following output : SubType

A  At line 8 change ´the return type from String to Object to be a correct
B  overloading of getTypeName()
C  No modification is needed
D  At line 16 change Type to SubType
E  At line 17 cast first.getTypeName() to String
<< First < Previous Flashcard Next > Last >>
Quiz Home Page
https://www.jobilize.com/ocjp-1z0-803-oca1-7-mock-exam-quiz-by-pankaj-kalra

OCA(1z0-803_OCA1.7)MockExamPI

Author:

Access: Public Instant Grading

Ask
Jemekia Weeden
Start Quiz
Michael Sag
Start Exam
Copy and paste the following HTML code into your website or blog.
<iframe src="https://www.jobilize.com/embed/ocjp-1z0-803-oca1-7-mock-exam-quiz-by-pankaj-kalra" width="600" height="600" frameborder="0" marginwidth="0" marginheight="0" scrolling="yes" style="border:1px solid #CCC; border-width:1px 1px 0; margin-bottom:5px" allowfullscreen webkitallowfullscreen mozallowfullscreen> </iframe>