Hi,
This is a question from a mock exam.
Given the following classes declaration in the same file MyClass1.java
A.Two classes can never be declared in the same file.
B.The code Does't compile as the top most class is
protected.
C.The code compiles & MyClass2 can only be instantiated
in it's sub classes.
D.The code compiles & MyClass2 can only be instantiated
by the classes in the package 'mypackage'.
B is the answer. I thought top most class the the one with the widest access modifer.
Can anybody explain to me why MyClass2 is the top level class here and how to identify it?