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

前端 未结 9 1303
旧巷少年郎
旧巷少年郎 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:40

    I also prefer to mark the args as final.

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

提交回复
热议问题