Check out example codes for "how to print array elements in java". It will help you in understanding the concepts better.

Code Example 1

import java.util.Arrays;

public class Array {

    public static void main(String[] args) {
        int[] array = {1, 2, 3, 4, 5};

        System.out.println(Arrays.toString(array));
    }
}

Code Example 2

import java.util.Arrays;

class Scratch{
    public static void main(String[] args){
        int[] arr = new int[3];
        System.out.println( Arrays.toString( arr ));
      	//prints [0, 0, 0]
    }
}

Code Example 3

int[] intArray = new int[] {1, 2, 3, 4, 5};
System.out.println(intArray);     // prints something like '[[email protected]'

Learn ReactJs, React Native from akashmittal.com