Check out example codes for "java create array with values". It will help you in understanding the concepts better.

Code Example 1

//Given values must match array type
int[] myIntArray = {1, 2, 3};

Code Example 2

int intArray[];    //declaring array
intArray = new int[20];  // allocating memory to array
//OR
int[] intArray = new int[20]; // combining both statements in one

Code Example 3

(file name) file name(s) = new (File name)[/*amount*/]
  
  void setup() {
  	for (int i = 0; i < (file name(s)).length; i++) {
    	 
    }
  }

Learn ReactJs, React Native from akashmittal.com