I believe top level classes can have no modifier as well (which is known as
default class
Test {
public static void main(
String args[])
{
System.out.println("Hello World!");
}
}
That should compile and print out Hello World. The class in this case is not public private or protected, but it is default.