Why is String[] args required in Java?

前端 未结 6 750
终归单人心
终归单人心 2020-12-03 21:33

I understand that String[] args is an array of strings passed into main as parameters.

java Print \"Hello, World!\"

 

         


        
6条回答
  •  一生所求
    2020-12-03 21:52

    The string[] parameter is used to save command line arguments with first being the class name. Moreover,if you call your main method without string[] it will simply be an overload and JVM will not be calling that method.And if you skip this signature main method JVM will throw an exception

提交回复
热议问题