Difference between int[] array and int array[]

前端 未结 25 3006
轻奢々
轻奢々 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:14

    Both have the same meaning. However, the existence of these variants also allows this:

    int[] a, b[];
    

    which is the same as:

    int[] a;
    int[][] b;
    

    However, this is horrible coding style and should never be done.

提交回复
热议问题