It's not a secret anymore!
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Marcus Green: incorrect answer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Marcus Green: incorrect answer?" Watch "Marcus Green: incorrect answer?" New topic

Marcus Green: incorrect answer?

Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504

What will happen when you attempt to compile and run this code?

1) Compilation and output of count from 0 to 99
2) Compilation and no output
3) Compile time error: class Runt is an abstract class. It can't be instantiated.
4) Compile time error, method start cannot be called directly

Well, I guess this should've been none of the above because technically speaking Runt is all but abstract. Here's the compiler error:

Chapter 7) Threads
Jose Botella
Ranch Hand

Joined: Jul 03, 2001
Posts: 2120
I agree with you Vad.

SCJP2. Please Indent your code using UBB Code
Jeff Bosch
Ranch Hand

Joined: Jul 30, 2003
Posts: 805
You're right, Vad -
There's no implementation of run() in Runt, so it must be declared abstract (which it isn't). I can see where the author may say that (3) is correct, except for the missing abstract declaration.
Correct answer: none of the above.
Good catch!
[ October 06, 2003: Message edited by: Jeff Bosch ]

Give a man a fish, he'll eat for one day. Teach a man to fish, he'll drink all your beer.
Cheers, Jeff (SCJP 1.4, SCJD in progress, if you can call that progress...)
Marcus Green
arch rival

Joined: Sep 14, 1999
Posts: 2813
Can you identify this question either the static page url and question no or id given if it is from a database.

SCWCD: Online Course, 50,000+ words and 200+ questions
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
Hi Marcus, it's Question 1 right under the Quiz header in Chapter 7 (Threads), and here's the hyperlink:
Threads Section
I agree. Here's the link:
subject: Marcus Green: incorrect answer?
It's not a secret anymore!