others - 在Java中创建ArrayList时,“ArrayList cannot be resolved to a type”错误

试图创建一个只能包含整数的arraylist ,下面是我的代码:


import java.util.*;



public class minimum{


 public static void main(String[] args) {


 Scanner input = new Scanner(System.in);


 ArrayList<Integer> numbers = new Arraylist<Integer>();


 System.out.println("Enter First Number");


 numbers.add(input.nextInt());


 System.out.println("Enter Second Number");


 numbers.add(input.nextInt());


 System.out.println("Enter Third Number");


 numbers.add(input.nextInt());


 input.close();


 int minimumValue = numbers.get(0);


 for (int i = 1; i < numbers.size(); i++){


 if(numbers.get(i) < minimumValue) {


 minimumValue = numbers.get(i);


 }


 }


 System.out.println("The minimum value is:" + minimumValue);


 }


}



但是,在运行代码时,我总是会得到此错误:


Exception in thread"main" java.lang.Error: Unresolved compilation problem:


 Arraylist cannot be resolved to a type



 at minimum.main(minimum.java:7)



我是java的初学者。

时间:

你有new Arraylist,它应该是new Arraylist (大写l ),java中名称区分大小写。

...