Check out example codes for "arrays in java". It will help you in understanding the concepts better.

Code Example 1

For example: int[ ] num = new int[6];
public class AccessingArrayElements
{
   public static void main(String[] args)
   {
      int[] arrNum = {25, 23, 15, 20, 24};
      for(int a = 0; a < arrNum.length; a++)
      {
         System.out.println(arrNum[a]);
      }
   }
}

Code Example 2

int[] arr;			// Declaration dataType can int, float etc.
arr = new int[N];	// Allocation N = 0 to 2,147,483,647.

Code Example 3

int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 }; 
 // Declaring array literal

Code Example 4

type var-name[];
OR
type[] var-name;

Code Example 5

int[] intArray = new int[]{ 1,2,3,4,5,6,7,8,9,10 }

Code Example 6

int[] intArray = new int[20];
String[] cars = {"Volvo", "BMW", "Ford", "Mazda"};

Learn ReactJs, React Native from akashmittal.com