aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Bug in K&B book 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 "Bug in K&B book" Watch "Bug in K&B book" New topic
Author

Bug in K&B book

Avishek Banerjee
Greenhorn

Joined: Jul 11, 2006
Posts: 17
I think the code in Figure 3.5 of SCJP 5 book has a bug. The code says:



This code will not compile. The second parenthesis after the first line should not be present.


Avishek<br />SCJP 5.0 - 90%
Atul Sawant
Ranch Hand

Joined: Jul 06, 2006
Posts: 304
Correct.

It should be...

Cats[][] myCats =
{{new Cat("Fluffy"), new Cat("Zeus)},
{new Cat("Bilbo"), new Cat("Legolas"), new Cat("Bert")}};


Mission SCWCD. Mission SCJP Complete: SCJP 1.4 - 91%
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
You get my vote, simple braces count results in residual brace count of 1 not zero
Mr Bates, sir, put it in the list.


Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Jeronimo Sanchez
Greenhorn

Joined: Jul 17, 2006
Posts: 23
I have a recent copy of the book and the bug is already fixed.


Preparing SCJP 1.5
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
Wow Avishek!

I'm really worried! I've checked both versions of the book, 1.4 and 5.0, and neither one of them looks like the code you've listed???

Can you double check your copy of the book and get back to me?

Thanks,

Bert


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Avishek Banerjee
Greenhorn

Joined: Jul 11, 2006
Posts: 17
Mr. Bates,

My book does have this defect. But, I checked with friends. They don't have it. Might be some problem with my book. Its India, you know. Here copy right means right to copy . So, may be my vendor follows that definition.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
Wow!

Well I'm glad that your friends' books don't have that issue!

Good luck with your studies.

Bert
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Bug in K&B book