Home > Back-end >  Create an array of multiple
Create an array of multiple

Time:10-20

Static int arr0 []=new int [6].
Static int arr1=new int [] [6].
Static int arr2=new int [] [6].
Static int arr3 []=new int [6].
Static int arr4 []=new int [6].
Static int arr5 []=new int [6].
How to give a figure (50, for example), and then create an array of 50 directly

CodePudding user response:

Can take advantage of the two dimensional array

CodePudding user response:

 
@ Test
Public void testArr () {
Int [] [] a=new int [50] [6].
for(int i=0; ifor(int j=0; J & lt; A [I]. Length; J++) {
System. Out. Println (the String. Format (" [% d] [% d] value: % d ", I, j, a [I] [j]));
}
}
}

CodePudding user response:

String tdarr [] []=new String [1] [50]. On behalf of a line of 50

CodePudding user response:

refer to the second floor street vendor reply:
 
@ Test
Public void testArr () {
Int [] [] a=new int [50] [6].
for(int i=0; ifor(int j=0; J & lt; A [I]. Length; J++) {
System. Out. Println (the String. Format (" [% d] [% d] value: % d ", I, j, a [I] [j]));
}
}
}
good
  • Related