Answers for "decaration array"

3

decaration array

//1-dimensional array 10
int[] array = new  int[10];

//2-dimensional array 10x5
int[][] array = new  int[10][5]; //

/* 
   |  Or it can also be declared by setting some values          |
   |  The dimensions of the array will be obtained 			     |
   |  automatically by the compiler according to the declaration | 
*/
int array[] = {1,2,3,4,5,6}; //---> array[6]
int array[][] = { {1,2,3,4},{5,6,7,8},{9,10,11,12} }; //---> array[3][4]
Posted by: Guest on May-04-2022

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language