This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Inner Classes. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Inner Classes." Watch "Inner Classes." New topic
Author

Inner Classes.

neha kanwal
Greenhorn

Joined: Jan 30, 2007
Posts: 11
Which of the following are TRUE about inner class? Mark
I found this question in one of the books. Can anyone pls calrify my doubts about this query.



Answer: BE
My Answer: CE
Chandra Bhatt
Ranch Hand

Joined: Feb 28, 2007
Posts: 1707
Hi Neha!

Answers B and E are correct.

An anonymous class can extend a class or implement an interface at a time not both.

An inner class can be instantiated outside of a class provided it is not private but only using the reference of the outer class. That is you must create an instance of the outer class to instantiate the inner class. This is the case of (non static inner class). To instantiate a static inner class you dont require to first instantiate the outer class. You do like this:

Outer.inner in = new Outer.inner(); //inner is static

Regards,
CMBHATT


cmbhatt
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Inner Classes.
 
Similar Threads
Valiveru Mock Exam Question :Question 34.
Inner class mult choice
Reg. Inner classes : Valiveru's exam
Inner
4 questions from valiveru mock test