Online Java Compiler By
JavaTpoint.com
import java.util.ArrayList; public class ArrayListAddAllExample5 { ArrayList
numbers = new ArrayList<>(); numbers.add("1"); numbers.add("2"); numbers.add("3"); System.out.println(numbers); // [1, 2, 3] System.out.println(numbers .size()); // prints: 3 ArrayList
letters = null; numbers.addAll(0, letters); // fires NullPointerException }
Output