This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates 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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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
Author

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="http://www.rajindery.com" 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
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
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.
Bill
Valentin Crettaz
Gold Digger
Sheriff

Joined: Aug 26, 2001
Posts: 7610
The same question has been asked 2 days ago, please check it:
http://www.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=24&t=014925


SCJP 5, SCJD, SCBCD, SCWCD, SCDJWS, IBM XML
[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!
 
 
subject: Exam Q on Bill Brogden site