This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Object Orientation

 
Ikechukwu Morah
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 7610
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ikechukwu Morah
Greenhorn
Posts: 18
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Velatin,
Thanks a lot for your answer.
It's me,
Ikechukwu Morah
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic