Hi all ,
This question is from another post.There is a discussion for this question
http://www.javaranch.com/ubb/Forum24/HTML/006450.html[/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.
quote:
--------------------------------------------------------------------------------
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.