Difference between int[] array and int array[]

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

    The two commands are the same thing.

    You can use the syntax to declare multiple objects:

    int[] arrayOne, arrayTwo; //both arrays
    
    int arrayOne[], intOne; //one array one int 
    

    see: http://java.sun.com/docs/books/jls/second_edition/html/arrays.doc.html

提交回复
热议问题