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

Code Example 1

Arrays.toString(list.toArray())

Code Example 2

// Java program to demonstrate the 
// working of ArrayList in Java 
  
import java.io.*; 
import java.util.*; 
  
class ArrayListExample { 
    public static void main(String[] args) 
    { 
        // Size of the 
        // ArrayList 
        int n = 5; 
  
        // Declaring the ArrayList with 
        // initial size n 
        ArrayList<Integer> arrli 
            = new ArrayList<Integer>(n); 
  
        // Appending new elements at 
        // the end of the list 
        for (int i = 1; i <= n; i++) 
            arrli.add(i); 
  
        // Printing elements 
        System.out.println(arrli); 
  
        // Remove element at index 3 
        arrli.remove(3); 
  
        // Displaying the ArrayList 
        // after deletion 
        System.out.println(arrli); 
  
        // Printing elements one by one 
        for (int i = 0; i < arrli.size(); i++) 
            System.out.print(arrli.get(i) + " "); 
    } 
}

Learn ReactJs, React Native from akashmittal.com