-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTest1.java
More file actions
36 lines (32 loc) · 920 Bytes
/
Test1.java
File metadata and controls
36 lines (32 loc) · 920 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package BasicAndDontKnow;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
public class Test1 extends Test{
public static void main(String[] args) {
Test1 test1=new Test1();
test1.a("2");
final int a=9;
Map<Integer, Integer> map=new HashMap<>();
map.put(1, 1);
map.put(2, 2);
Iterator iterator=map.keySet().iterator();
while(iterator.hasNext()){
Integer integer=(Integer) iterator.next();
System.out.println("键:"+integer+" 值:"+map.get(integer));
}
//动态数组
List<String> arrayList=new ArrayList<>();
arrayList.add("12");
arrayList.add("23");
Iterator<String> iterator2=arrayList.iterator();
while(iterator2.hasNext()){
System.out.println(iterator2.next());
}
for(Iterator iterator3=arrayList.iterator();iterator3.hasNext();){
System.out.println(iterator3.next());
}
}
}