Difference between int[] array and int array[]

前端 未结 25 2963
轻奢々
轻奢々 2020-11-21 07:18

I have recently been thinking about the difference between the two ways of defining an array:

  1. int[] array
  2. int array[]
  3. <
25条回答
  •  走了就别回头了
    2020-11-21 08:03

    It is an alternative form, which was borrowed from C, upon which java is based.

    As a curiosity, there are three ways to define a valid main method in java:

    • public static void main(String[] args)
    • public static void main(String args[])
    • public static void main(String... args)

提交回复
热议问题