The main() method must be public. It is static so that it can be executed without constructing an instance. The return type must be void. public class MainClass{ public static void main(String[] args){ } }