我想在ArrayList中存储一个值,但我该怎么做呢?
这是我的代码:
public class JavaTutorials{
static double cor = 3.90000231;
static double result = 0;
static ArrayList<Double> chilist = new ArrayList<>();
static ArrayList<Integer> ilist = new ArrayList<>();
public static void main(String[] args) throws InterruptedException{
int j;
for(j = 0; j <= 999999999; j++){
result = result * cor + j;
}
}
}
感谢。
答案 0 :(得分:1)
public static void main(String[] args) throws InterruptedException{
int j;
for(j = 0; j <= 999999999; j++){
result = result * cor + j;
chilist.add(result)
}
}
这样的事情?