File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "comprehensive exam(kathy/Bert book)" Watch "comprehensive exam(kathy/Bert book)" New topic
Author

comprehensive exam(kathy/Bert book)

Saith Govind
Greenhorn

Joined: Jan 24, 2003
Posts: 13
import java.io.*;
public class Bing{
Bing(String s){}
Bing(){ }
}
import java.io.*;
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
Saith,
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="http://www.danchisholm.net/" target="_blank" rel="nofollow">Try my mock exam.</a>
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
We have discussed that question last week, wait... here it is: http://www.coderanch.com/t/241079/java-programmer-SCJP/certification/anon-inner-class-Sierra-Bates
It seems that the "Foo" thing is a typo since it does not appear in the manuscript I got for the tech review.


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[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
Hi,
Is there any location online where I can find all the erratta of this book.
Thanks in advance,
Param
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8764
    
    5
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 wickedlysmart.com
2) If you find an error, please send us an email at wickedlysmart.com (either bert.bates or kathy.sierra).
This way we will be sure not to miss any of the errors that you find!
Back soon!
-Bert
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.

Param
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: http://aspose.com/file-tools
 
subject: comprehensive exam(kathy/Bert book)
 
Similar Threads
anonymous inner class question
Java2 Certification - Anonymous Inner Class question
Anonymous Inner class from K&B mock exam
Anno. Class Question
Error in MasterExam?