File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes comprehensive exam(kathy/Bert book) 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 "comprehensive exam(kathy/Bert book)" Watch "comprehensive exam(kathy/Bert book)" New topic

comprehensive exam(kathy/Bert book)

Saith Govind

Joined: Jan 24, 2003
Posts: 13
public class Bing{
Bing(String s){}
Bing(){ }
public class Bang extends Bing{
Bang(){ }
Bang(String bangS){super(bangS);}
//Insert code here
what code if inserted at the comment would not result in any errors
Answers given are
1) Bing b = new Bang(){};
2) Bing b = new Bing(){"Foo";}

But if (2) is placed at the comment, the code does not compile. How is (2) correct??
Dan Chisholm
Ranch Hand

Joined: Jul 02, 2002
Posts: 1865
It appears that you are correct. I'm sure that Bert will be here soon to offer a response.

Dan Chisholm<br />SCJP 1.4<br /> <br /><a href="" target="_blank" rel="nofollow">Try my mock exam.</a>
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
We have discussed that question last week, wait... here it is:
It seems that the "Foo" thing is a typo since it does not appear in the manuscript I got for the tech review.

[Blog] [Blogroll] [My Reviews] My Linked In
Sarma Lolla
Ranch Hand

Joined: Oct 21, 2002
Posts: 203
I agree that it wouldn't compile. But when taking this question I selected that as one of the correct options. Because we need to select two.
I found that there is wrong answer for one of the bitwise operation questions in Master exam 1 and in Master exam 2 there are at least two questions that have wrong anser.
I will post these questions in the coming days on this forum.
[ March 11, 2003: Message edited by: Sarma Lolla ]
Param Yanamandra
Ranch Hand

Joined: Jun 06, 2002
Posts: 33
Is there any location online where I can find all the erratta of this book.
Thanks in advance,
Bert Bates

Joined: Oct 14, 2002
Posts: 8898
Sarma and Param,
We want to thank all the JavaRanchers for using our book!
We try to answer as many posts as we can, but we are not always able to answer them all!
For instance, we will be gone for the next several days.
We have two requests in general:
1) Please check the errata page at
2) If you find an error, please send us an email at (either bert.bates or kathy.sierra).
This way we will be sure not to miss any of the errors that you find!
Back soon!
p.s. - Valentin is correct, the question listed at the beginnning of this thread does have a typo
[ March 11, 2003: Message edited by: Bert Bates ]

Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Param Yanamandra
Ranch Hand

Joined: Jun 06, 2002
Posts: 33
Thanks Bert for putting them online. It will be lot easier.

Marlene Miller
Ranch Hand

Joined: Mar 05, 2003
Posts: 1391
2) Bing b = new Bing(){"Foo";}
Do you suppose what they meant to say is
Bing b = new Bing("Foo"){};
I agree. Here's the link:
subject: comprehensive exam(kathy/Bert book)
It's not a secret anymore!