This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Object Orientation Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Object Orientation" Watch "Object Orientation" New topic

Object Orientation

Ikechukwu Morah

Joined: Nov 01, 2002
Posts: 18
Which of the following are true and why?
1. An anonymous inner class may be declared as final.
2. An anonymous inner class can access final variables in any enclosing scope.
3. An anonymous class can be declared as private.
4. An anonymous inner class can implement multiple interfaces.
Valentin Crettaz
Gold Digger

Joined: Aug 26, 2001
Posts: 7610
The correct answer is 2.
All the information you need can be found in Programmer's Guide to Java Certification: A Comprehensive Primer : Chapter 7 - Inner classes (7.5 Anonymous classes
Moreover, you should always try to create a piece of code for questions like this so you can directly see whether the answer is correct or wrong. Yes, practice is part of the certification path, too

[Blog] [Blogroll] [My Reviews] My Linked In
Ikechukwu Morah

Joined: Nov 01, 2002
Posts: 18
Thanks a lot for your answer.
It's me,
Ikechukwu Morah
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: Object Orientation
Similar Threads
some questions of anonymous inner class
Two questions about mock exam
Can anonymous inner class be declared as final?
Anonymous Inner class
anonymous inner class question