Skip to content

Commit 7856f0c

Browse files
committed
update
1 parent c1ad015 commit 7856f0c

7 files changed

Lines changed: 166 additions & 180 deletions

File tree

javase/code/CollectionDemo/.idea/vcs.xml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

javase/code/CollectionDemo/.idea/workspace.xml

Lines changed: 151 additions & 171 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

javase/code/CollectionDemo/src/com/mashibing/IteratorDemo.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,24 @@ public static void main(String[] args) {
3939
list.add(2);
4040
list.add(3);
4141
list.add(4);
42-
// for(int i=0;i<list.size();i++){
43-
// System.out.println(list.get(i));
44-
// }
42+
for(int i=0;i<list.size();i++){
43+
System.out.println(list.get(i));
44+
}
4545

4646
//迭代器
47-
// Iterator iterator = list.iterator();
48-
ListIterator iterator = list.listIterator();
47+
Iterator iterator = list.iterator();
48+
// ListIterator iterator = list.listIterator();
4949
while(iterator.hasNext()){
5050
Object o = iterator.next();
5151
if(o.equals(1)){
5252
iterator.remove();
5353
}
5454
System.out.println(o);
5555
}
56-
System.out.println("-------------");
57-
while (iterator.hasPrevious()){
58-
System.out.println(iterator.previous());
59-
}
56+
// System.out.println("-------------");
57+
// while (iterator.hasPrevious()){
58+
// System.out.println(iterator.previous());
59+
// }
6060
// for(Object i : list){
6161
// System.out.println(i);
6262
// }

0 commit comments

Comments
 (0)