我想在 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;
}
}
}
谢谢。
最佳答案
public static void main(String[] args) throws InterruptedException{
int j;
for(j = 0; j <= 999999999; j++){
result = result * cor + j;
chilist.add(result)
}
}
类似这样的东西吗?
关于java - 如何创建一个新变量来存储在 ArrayList 中?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36158478/