can't find main(String[]) method in class

前端 未结 1 825
不知归路
不知归路 2021-01-29 13:01

I am getting the following error :

can\'t find main(String[]) method in class

impor         


        
相关标签:
1条回答
  • 2021-01-29 13:24

    Java is looking for the main method in the classname.java file you want to compile. The name of the file has to correspond with the class found in it.

    My suggestion is, that your file is not named TcsDigital.java, therefore java is taking the first java class it finds, which is Coor. Since Coor does not contain a main method an error occurs. You should try renaming your file to TcsDigital.java.

    I recommend to write every java class in a sepreate file and to import them as needed. An additional Main class containing only the main method is an option, too.

    0 讨论(0)
提交回复
热议问题