小编spe*_*ial的帖子

从数组列表中删除元素并在java中更新选项卡大小

我有这个简单的程序,我需要element从数组列表中删除并更新循环中的大小.

dist fin并且tab2arrays lists

int k=2;
int count =0;

int temp,num;//lets say this 2 vars are known and positive 

while (k > 0){
    while(count < dist.size()){

        double num=dist.get(count);

        if (temp>num){
        temp = num;
        }
        count++;
    }

    int e = dist.indexOf(temp);   
    fin.add(tab2.get(e));
    dist.remove(e);

   System.out.print(fin);
   System.out.print(dist);
   System.out.print(dist.size());

   k--;
}
Run Code Online (Sandbox Code Playgroud)

这只给我一次迭代,然后停止.

java arrays

1
推荐指数
1
解决办法
53
查看次数

标签 统计

arrays ×1

java ×1