This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Exam Q on Bill Brogden site Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Exam Q on Bill Brogden site" Watch "Exam Q on Bill Brogden site" New topic

Exam Q on Bill Brogden site

Rajinder Yadav
Ranch Hand

Joined: Jan 18, 2002
Posts: 178
Check all correct answers
a) An inner class can have the same name as its enclosing class.
b) An instance of a non static inner class always has an associated instance of the enclosing class
c) An anonymous inner class is always assumed to extend Object.
Ans: b)
I choose b,c why is c not a correct answer?

<a href="" target="_blank" rel="nofollow">Rajinder Yadav</a><p>Each problem that I solved became a rule which served afterwards to solve other problems. --Rene Descartes
Erik Dark
Ranch Hand

Joined: Jan 28, 2002
Posts: 107
As the name implies, anonymous inner classes have no name. Instead the use the name of the class that they subclass which can be any class...
Beware that because of this way of declaration they do not use extends!
Erik Dark
[ February 24, 2002: Message edited by: Erik Dark ]
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
Many uses of anonymous inner classes in fact extend classes like event adapters or Thread. That is what I was trying to bring out in that question.
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
The same question has been asked 2 days ago, please check it:

[Blog] [Blogroll] [My Reviews] My Linked In
Rajinder Yadav
Ranch Hand

Joined: Jan 18, 2002
Posts: 178
Thanks everyone for helping me clear up my confusion!
It is sorta covered in the JavaRanch Style Guide.
subject: Exam Q on Bill Brogden site
jQuery in Action, 3rd edition