相关疑难解决方法(0)

如何更改特定范围的ArrayList?

在Java中,我知道要对一个ArrayList进行洗牌,方法Collections.shuffle()存在,但是这会洗牌整个列表.

我怎么能写一个方法(或者,有人可以写它并给我看吗?)如下:

private ArrayList<AnObject> list;

/**
 * Shuffles the concents of the array list in the range [start, end], and 
 * does not do anything to the other indicies of the list.
 */
public void shuffleArrayListInTheRange(int start, int end)
Run Code Online (Sandbox Code Playgroud)

java collections arraylist

12
推荐指数
2
解决办法
2205
查看次数

标签 统计

arraylist ×1

collections ×1

java ×1