aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Doubt in K&B SCJP 5: topic Assignments Pg. 182, 183 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Doubt in K&B SCJP 5: topic Assignments Pg. 182, 183" Watch "Doubt in K&B SCJP 5: topic Assignments Pg. 182, 183" New topic
Author

Doubt in K&B SCJP 5: topic Assignments Pg. 182, 183

Rohan Dhruva
Ranch Hand

Joined: May 08, 2007
Posts: 183
In pg. 182 of the book, on the last code snippet on the page, two bytes "b" and "c" are added into "d". However, on referring to the same code snippet in pg. 183, the code is displayed as if two bytes "a" and "b" are added into "c".

I am using the Indian reprint by "Dreamtech Press" which mentions "Edition: 2007" on the 4th page. Is this error introduced in my edition of the book, or is a genuine errata ?


Rohan B. Dhruva
SCJP 1.5
Nik Arora
Ranch Hand

Joined: Apr 26, 2007
Posts: 652
Hi,
Can you post the question because what you are asking is not clear. Can you elaborate?.



Regards
Nik
Scjp 1.5
Rohan Dhruva
Ranch Hand

Joined: May 08, 2007
Posts: 183
OK, Nik, I'll try to elaborate. On page 182, in the bottom most code snippet:

byte b = 3;
byte c = 8;
byte d = b + c;
Now, that last statement is wrong and gives a compile error. On page 183, in the compile error, the error is shown as

"Loss of precision.. byte c = a + b;" which I think is a mistake, because we are adding d = b + c;
Similarly, just below that code, the correct code is shown, which again refers to a, b, c:

byte c = (byte) (a+b); which I think should be
byte d = (byte) (b+c);

I hope that's clear ? Basically, it's just a mistake in the name of the variables from one page to the other.
Manfred Klug
Ranch Hand

Joined: Jun 04, 2007
Posts: 377
Hi Rohan,

it's a genuine errata, since the english version contains the mistake too.
Burkhard Hassel
Ranch Hand

Joined: Aug 25, 2006
Posts: 1274
Heus, bubulci! (*)

One erratum, singular.
Several errata, plural.


Yours,
Bu.

(*) = howdy, cowboys!
 
 
subject: Doubt in K&B SCJP 5: topic Assignments Pg. 182, 183