• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

comprehensive exam(kathy/Bert book)

 
Saith Govind
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1865
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saith,
It appears that you are correct. I'm sure that Bert will be here soon to offer a response.
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sarma Lolla
Ranch Hand
Posts: 203
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is there any location online where I can find all the erratta of this book.
Thanks in advance,
Param
 
Bert Bates
author
Sheriff
Posts: 8898
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Param Yanamandra
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bert for putting them online. It will be lot easier.

Param
 
Marlene Miller
Ranch Hand
Posts: 1392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
2) Bing b = new Bing(){"Foo";}
Do you suppose what they meant to say is
Bing b = new Bing("Foo"){};
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic