Two Main methods with different signatures

后端 未结 10 1514
旧时难觅i
旧时难觅i 2021-01-18 17:53

I have following class.

public class Test {

    public static void main(Integer[] args) {
        System.out.println(\"This is not a main\"); 
    }   

           


        
10条回答
  •  -上瘾入骨i
    2021-01-18 18:14

    This is the only signature recognized by the JVM as THE MAIN METHOD

    public static void main(String[] args)
    

    You can have as many overloaded main method as you want BUT only the method with the above signature will be called by the jvm

提交回复
热议问题