Wireless loop after traversal output of collection

CSDN Q & A 2022-05-14 13:21:30 阅读数:169

wirelesslooptraversaloutputcollection

I sort ten randomly generated random numbers from one to one hundred , Why is it infinite loop after traversing the output method true?

img




Take the answer :

What you output is not the element in the set , Instead, it determines whether the next element exists , So the print is true
31 Modify row output to :

System.out.println(iterator.next());

img


版权声明:本文为[CSDN Q & A]所创,转载请带上原文链接,感谢。 https://qdmana.com/2022/134/202205071908268968.html