File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Reg. Inner classes : Valiveru's exam 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 "Reg. Inner classes : Valiveru Watch "Reg. Inner classes : Valiveru New topic

Reg. Inner classes : Valiveru's exam

Angela Narain
Ranch Hand

Joined: Apr 14, 2001
Posts: 327
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
What are the correct answers ?
I assumed B, C, D
Gagan Indus
Ranch Hand

Joined: Feb 28, 2001
Posts: 346
i guess only B & D are correct
A) Instance of Inner classes can be made , where they are accessible , using inner()
C)Anonymous class can either implement an interface ( in dat case , they be extending from Object class ) OR extend a class , but NOT BOTH
E) Inner class ( local or anonymous ) can be implicitly static , when its declared in static context ( like static initializer )
F) Instance of anonymous class can only be created at da place they r declared .

Gagan (/^_^\)

Gagan (/^_^\) SCJP2 SCWCD IBM486 <br />Die-hard JavaMonk -- little Java a day, keeps you going.<br /><a href="" target="_blank" rel="nofollow">My Blog</a>
I agree. Here's the link:
subject: Reg. Inner classes : Valiveru's exam
It's not a secret anymore!