簡體   English   中英

如何創建一個新變量以存儲在ArrayList中?

[英]How to create a new variable to store in an ArrayList?

我想將值存儲在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)
    }
}

這樣的東西?

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM