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

前端 未结 9 1323
旧巷少年郎
旧巷少年郎 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-06 08:51

    No, the above are equivalent. Arrays in Java can be declared in one of two ways, either:

    String[] myarray;
    

    or

    String myarray[];
    

提交回复
热议问题