Volker Glave

Greenhorn
+ Follow
since Aug 16, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Volker Glave

BB wrote:

> [...]
> hth

Yes, thank you, I do follow.
Volker Glave
Hi, Arul.

Arul Prasad wrote:
> you are right , but i hope this question is not
> concentrating on which line Compile Error has occured,
> but it was the reason why the compilation fails,
> eventhough the compile Error happen in the line No 8
> ...
> but the reason was not the illegal statment in line
> no 8 but it was because of the illegal statement in
> the line 7 ...

Yeah, this reasoning follows the one given in K&B.
But it's not right either. Yes, the illegal statement
has to be corrected by adding a semicolon. But this
adding does not _necessarily_ has to be on line 7.
It could quite equally be added on line 8, for
example:


So again, the correct answer to the Self Test question
"What is the result?" is "F. Compilation fails because
of an error on line 8." - and that's it!, since the error
_is_ on line 8.

One has to be merciless about this, I think, since
accuracy is one of the fundamentals the SCJP exam is
all about in the first place.

Greetings
Volker
In K&B SCJP 5 this is the given solution to Chapter 8
Self Test 9 (pages 662/669/670):



First I voted "G", too, but then switched to "F".
Because, yes, the semicolon is missing, but the compiler will
flag this as an error not until line 8 at the "System".

Enough talking, let's verify:



qed

Three questions:

- Is it really an error in K&B SCJP 5 or am I missing something?

- I looked up the "K&B, SCJP 5 - Errata: Updated 7/28/06" page.
A correction to page 669 is given:
"669....typo......Answer s/b: A,B,D,E, and F are incorrect"
That's even more mysterious to me. First, based on the things
above it's not a correction. Second, why "C" is taken away?

- More important: At the real SCJP exam, can you be (on one
question or the other) just be "to smart" ;-) ... and should
you anticipate and click the would-by-correct-answer even if
you know it's wrong :-) ?

Regards,
Volker Glave