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 khalid mughal Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "khalid mughal" Watch "khalid mughal" New topic

khalid mughal

shabbir zakir
Ranch Hand

Joined: Nov 12, 2000
Posts: 183
which of these statements concerning nested classes are true?
a) An instance of a top-level nested class has an inherent outer instance.
b)A top-level nested class can contain non-static member variables.
c)A top-level nested interface can contain non-static member variables.
d)A top-level nested interface has an inherent outer instance.
e) For each instance of the outer class,there can exist many instances of a non-static inner class.
The answers given are b & e. why cannot option c cannot be true.
For instance
class a
int i = 10;
static class v
static interface x {
void amethod();
int x = 10;

this code is compiling fine. Now i think that the option c is correct.
nitin sharma
Ranch Hand

Joined: Feb 24, 2001
Posts: 290
c,is not the correct answer, reason being when u declare variable's inside an interface they r implicitly public, static , final.wheteher u specify static modifier in front of the variable's declaration or not it does not effect because variable's implicitly becomes static.
I agree. Here's the link:
subject: khalid mughal
It's not a secret anymore!