You need to define main method signature like this public static void main(String[] args) because this is entry point of your program. Also, You can save your .java filename with the same name of defined public class of your source code.