Questions tagged «listiterator»

3
迭代器和Listiterator之间的区别?
Iterator ite = Set.iterator(); Iterator ite = List.iterator(); ListIterator listite = List.listIterator(); 我们可以使用Iterator遍历a Set或a List或a Map。但是ListIterator只能用于遍历a List,不能遍历a Set。为什么? 我知道主要的区别在于,使用迭代器,我们只能在一个方向上运行,而ListIterator我们可以在两个方向上运行。还有其他区别吗?和任何优势ListIterator了Iterator?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.