class Blog{
public static void main(String args[]){
System.out.println("overflow");
}
}
I am saving this file with name First.java and compiling it than it is generating file with Blog.class and gives output:
overflow
If same program i am writing as given below:-
public class Blog{
public static void main(String args[]){
System.out.println("overflow");
}
}
it gives error after compiling
First.java:3: error: class Blog is public, should be declared in a file named Blog.java