permaculture playing cards
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 Java SE 8 Programmer I Study Guide this week in the OCAJP 8 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: 13018
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!
I agree. Here's the link:
subject: Exam Q on Bill Brogden site
It's not a secret anymore!