I am trying to run this java program in vscode but it shows an error on the 2nd line (The import java.util.ArrayList cannot be resolved Java(268435846)) and 6th line. But it gives correct output in an online compiler. Any suggestions?
import java.util.List;
import java.util.ArrayList;
import java.util.Collection;
public class CollectionDemo {
public static void main(String[] args) {
ArrayList al = new ArrayList();
al.add(100);
al.add("String");
System.out.println(al);
}
}