Two Main methods with different signatures

后端 未结 10 1446
旧时难觅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条回答
  •  执笔经年
    2021-01-18 18:10

    Command-line arguments are arguments to the main() method which are passed to it at run-time. Since Java uses only String type command-line arguments, the JVM ignores the other main() method which passes Integer.

提交回复
热议问题