arrays in java

Java
//Metodo 1
type nome = new type[n];

//Metodo 2
type nome[];
nome = new type[n];int[] arr;			// Declaration dataType can int, float etc.
arr = new int[N];	// Allocation N = 0 to 2,147,483,647.int[] array1 = new int[5]; //int array length 5
String[] array2 = new String[5] //String array length 5
double[] array3 = new double[5] // Double array length 5
int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 }type var-name[];
OR
type[] var-name;
int[] intArray = new int[20];
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};
Source

Also in Java: