Originally posted by Mani vannan:
... A nested class is identified by static modifier. As, you say it is not nested class, you can eliminate the option (e)static. All the remaining options are valid {public, private, protected, final, abstract}.
No.
According to the Java Language Specification, "An inner class is a nested class that is not explicitly or implicitly declared static."
Ref:
http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.1.3 So if we know that the class is not nested (as stated in the original question), then it is also not inner. In fact, it is a top level class, as the JLS states, "A
top level class is a class that is not a nested class."
Ref:
http://java.sun.com/docs/books/jls/third_edition/html/classes.html Therefore, it is
not true that all the remaining modifiers are valid. Per the JLS, "The access modifiers protected and private pertain only to member classes..." and the "access modifier static pertains only to member classes..."
Ref:
http://java.sun.com/docs/books/jls/third_edition/html/classes.html#8.1.1 [ October 21, 2005: Message edited by: marc weber ]