• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in MasterExam?

 
M. Herder
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
this is a question in the MasterExam II attached with the K&B book.

Which two create an anonymous inner class from within class Bang?
The reference told me that these are the correct answers:
c) Bing b = new Bing(){"Foo";};
d) Bing b = new Bang(){};
I think d) is OK, but c) should be :
Bing b = new Bing("Foo"){};
Do you agree?
Thanks!
 
Anupam Sinha
Ranch Hand
Posts: 1090
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Herder
I do agree. Just "Foo"; is not a legal statement.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic