This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Valiveru Mock Exam Question :Question 34. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Valiveru Mock Exam Question :Question 34." Watch "Valiveru Mock Exam Question :Question 34." New topic

Valiveru Mock Exam Question :Question 34.

Rosemol Thanjappan
Ranch Hand

Joined: Aug 08, 2000
Posts: 40
Hi all ,
This question is from another post.There is a discussion for this question[/url]
Valiveru Mock Exam Question :
Question 34.
Which of the following are true about inner classes

A. Inner classes can only be instantiated in its outer class
B. Inner classes can be protected or private
C. Anonymous inner class can be both an explicit subclass
and implements an interface.
D. Anonymous inner classes declare and instantiated at the
same place.
E. An inner class can be static only when it's outer class
is static.
F. An instance of an Anonymous inner class can only be
created in it's outer class
They said B and D but I chose F as well.

The following post makes sense.

Originally posted by Sahir Shah:
1. "An instance of an anonymous or local inner class can only be created within the scope of its declaration "
This statement is true.
2. "An instance of an anonymous or local inner class is accessible only within the scope of its declaration "
This statement is false.
Creating an object is not the same as passing a reference to an object around.

Can any moderators confirm this?
Thanking you Rosemol.
natarajan meghanathan
Ranch Hand

Joined: Feb 01, 2001
Posts: 130
Eventhough u cannot instantiate an outside its outer class, you can get a reference to it anywhere using the superclas it inherits or its outerclass method.
Refer KAM, there is a very good code for getting references.

Sun Certified Programmer for Java 2 Platform
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link:
subject: Valiveru Mock Exam Question :Question 34.
It's not a secret anymore!