No Main class found in NetBeans

前端 未结 16 2512
时光说笑
时光说笑 2020-11-30 08:32

I have been working on an assignment for my class in programming. I am working with NetBeans. I finished my project and it worked fine. I am getting a message that says \"No

16条回答
  •  盖世英雄少女心
    2020-11-30 09:15

    Also, for others out there with a slightly different problem where Netbeans will not find the class when you want when doing a browse from "main classes dialog window".

    It could be that your main method does have the proper signature. In my case I forgot the args.

    example: public static void main(String[] args)

    The modifiers public and static can be written in either order (public static or static public), but the convention is to use public static as shown above.

    Args: You can name the argument anything you want, but most programmers choose "args" or "argv".

    Read more here: http://docs.oracle.com/javase/tutorial/getStarted/application/

提交回复
热议问题