Reputation: 1
I was creating an ArrayList, and i am getting following error Exception in thread "main" java.lang.Error: Unresolved compilation problem: ArrayList cannot be resolved to a type Please help.
package learnCoreJava;
import java.util.List;
public class ArrayListDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
// Always initialize the concrete implementation with the interface types
List<Integer> arrayList = new ArrayList<>(5);
for(int i=0;i<=5;i++)
arrayList.add(i);
System.out.println(arrayList);
}
}
Upvotes: 0
Views: 2314