You are allowed to define more than one class in a file, but only one public class,which must be named as the file. So you could if you wanted do:
Code:
//Test.java
public class Test { // Named as the file (nb .java is not required)
public static void main(String[] args){ System.out.println("Test"); }
}
class NewName{ //because we're allowed to define other classes in this file
public static void main(String[] args){ System.out.println("NewName"); /*Won't run*/}
}
Cheers,
Charlie
--
Charlie Harvey's website - linux, perl, java, anarchism and punk rock:
http://charlieharvey.org.uk