Your class is called Main. There's a constructor-like method called RandomNumberGame but it does not fit the class name. Unless you wanted to call the method "randomNumberGame" ? It looks like you're confusing the concept of having a main method and naming a class "Main". Naming a class "Main" is not going to make it the entry point of your program.