Engineering Full Stack Apps with Java and JavaScript
Given the complete contents of TestClass.java file:
package x; public class TestClass { ArrayList<String> al; public void init(){ al = new ArrayList<>(); al.add("Name 1"); al.add("Name 2"); } public static void main(String[] args) throws Exception { TestClass tc = new TestClass(); tc.init(); System.out.println("Size = "+tc.al.size()); } }
Which import statement should be added to make it compile?
Select 1 option
A. import java.lang.*;
B. import java.lang.ArrayList;
C. import java.util.ArrayList;
D. import java. Collections. ArrayList;
E. No import is necessary.