On javaprepare.com I found the following question :
--
A top level class may have only the following access modifier. Select one correct answer.
A package
B friendly
C private
D protected
E public
--
They say the correct answer being E but what about the following class which compiles and runs.
-- File Simple.java ----
class Simple
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
In this case, the top level class has a package access !!!
I'm a bit puzzled and any help would be welcome
Regards
A. B.
--
A top level class may have only the following access modifier. Select one correct answer.
A package
B friendly
C private
D protected
E public
--
They say the correct answer being E but what about the following class which compiles and runs.
-- File Simple.java ----
class Simple
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
In this case, the top level class has a package access !!!
I'm a bit puzzled and any help would be welcome
Regards
A. B.