I've been lurking for a while, but thought I'd get some help with a question where the code doesn't seem to match the answer? My first look at C8.Q12 was to choose answer A, which is what the book said was correct, however when I typed the code in (and alternately cut-n-pasted from the pdf), I get a compilation error on "AbstractTest.Bar f = t.new Bar () {..."
Error(46,36): class AbstractTest.Bar is abstract; cannot be instantiated
I couldn't see anything in the Errata so I thought I'd check with the authors.
I'm starting to panic a bit as my exam is on Friday, and I'm worried that I haven't prepared enough (read the book a several times, done all the Sun mock exams twice + the K & B self tests & the examulator freebie exam).
Well the question is question no. 6 in my SCJP 6 book. The pdf doesn't let me to copy paste the code (I don't how it let you CUT paste the code ). Other than that I think the code must run fine. Just post the complete code here.
Same here. I've got the Sun JDK 1.6 on my PC as well as the Oracle 1.5 JDK inside JDeveloper. Just tried and it compiled quite happily in 1.6. Something odd with Oracle.
As I can't compile the code in the real exam, I'll have to go with my gut instinct, for some of the answers.
Hi Andrew, Even i am also preparing for SCJP1.5 I ran the same code (in Eclipse3.4 with Java1.5 installed) that you pasted above, and it is running fine and giving the output 57 22.
When Sun created the real exam, all of the questions were compiled and tested from the command line, and when we wrote the book we also used the command line exclusively.
Bottom line - we STRONGLY recommend NOT using IDEs to study for the exam.
Bert
Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
I thought I should let you know that I passed. Thanks go to Kathy and Bert for a 1st class book, especially the bit about exam techniques. Its going to be my new java reference bible.
Regards
Andrew
You'll never get away with this you overconfident blob! The most you will ever get is this tiny ad:
a bit of art, as a gift, that will fit in a stocking