我有一个Integer
键入ArrayList
,我想遍历我的列表,并能够匹配当前索引项的所有重复项。查找列表中的副本
for(int i = 0; i < list.size(); i++) {
if(list.get(i) == list.get())//stuck here
//I want to scan the list if the current element has the same value to
//other elements while ignoring the value of my current index
任何帮助,将不胜感激。谢谢!
我不明白你想要什么实现。代码应该返回或打印什么? “匹配每一个”不是很清楚。给出一个示例输入和一个示例输出。 –
由于卡住了,我还没有输出。我只希望for循环匹配'ArrayList'中的每个值,而忽略for循环中的当前索引(即'i') –
GGWP
如果您不知道输出**应该是什么**,你可以执行任何事情。 –