Confusion in Question

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
ageoval
Posts: 1
Joined: Wed Dec 04, 2013 7:49 am
Contact:

Confusion in Question

Post by ageoval »

Hi!
Wanna tell you about the incorrect answer to the following question:

Consider the following class...

class TestClass{
void probe(Integer x) { System.out.println("In Integer"); } //2

void probe(Object x) { System.out.println("In Object"); } //3

void probe(Long x) { System.out.println("In Long"); } //4

public static void main(String[] args){
String a = "hello";
new TestClass().probe(a);
}
}
What will be printed?


It's obviously that the answer is: "In Object".
But etsviewer tells us that we are wrong and that: "It won't compile"!
Last edited by admin on Sun Dec 08, 2013 9:59 pm, edited 1 time in total.
Reason: removed qid reference from title

admin
Site Admin
Posts: 10068
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.924 :

Post by admin »

I see that the correct answer is indeed specified as "In Object".

-Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 136 guests