Can there exist two main methods in a Java program?

后端 未结 16 848
后悔当初
后悔当初 2020-12-08 02:21

Can there exist two main methods in a Java program?

Only by the difference in their arguments like:

public static void main(String[] args)

16条回答
  •  渐次进展
    2020-12-08 03:01

    Only public static void main(String[] args) counts. This is the only signature considered to be the true main() (as the program entry point, I mean).

提交回复
热议问题