What is the correct Java main() method parameters syntax?

前端 未结 9 1314
旧巷少年郎
旧巷少年郎 2020-12-06 07:56

Is there a functional difference between these methods?

public static void main(String[] args) { }

public static void main(String args[]) { }
9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-06 08:36

    There is not a difference between the 2 choices you can do either one of them.

    You could also put this:

    public static void main(String... args) { }
    

提交回复
热议问题