class First
{
public static void main(String[] args)
{
System.out.println("File found");
}
}
(File saved with First.java)
javac First.java ---(no error)
java First --- no error
then I change name of class to "class Second"
javac First.java --- (no error)
java Second --- no error
but If I add public and change the name of class to "public class Second"
then there is a compile time error that file should be saved with the same name as of
public class.