Using int Instead Of String: public static void main (int[] args)

前端 未结 4 589
一生所求
一生所求 2020-12-16 07:19

I was under the impression that the main method had to have the form \"public static void main (String[] args){}\", that you couldn\'t pass int[] arguments.

However,

4条回答
  •  一整个雨季
    2020-12-16 08:23

    This code contains public static void main (int[] args) which does not works. Because the JVM takes the argument values as a string argument. It does not take any int argument. So if we want a int argument means we have to convert the string argument into integer argument. For running this code valid main method is required (ex:public static void main(String args[]))

提交回复
热议问题