我需要打印这个数组列表,有人可以帮忙吗?我从普通的双人间变成了双人间,但它仍然无法工作,请帮忙。
导入 java.util.*;
公共类高地{
static ArrayList <Double> Heights = new ArrayList <Double>();
public static void main(String[] args) {
//use it use the method
addsomeheight(5.1);
addsomeheight(6.2);
addsomeheight(6.3);
addsomeheight(5.4);
addsomeheight(5.5);
addsomeheight(5.6);
addsomeheight(5.7);
addsomeheight(5.8);
addsomeheight(5.9);
addsomeheight(6.9);
//declare a new method
}
private static void addsomeheight(Double x) {
for (Double x1 : Heights){
System.out.println(x1);
}
}
}