📄 hashmap.java
字号:
import java.util.*;
class hashmap
{
public static void main(String args[])
{
HashMap hashmap1 = new HashMap();
hashmap1.put("Item 0", "Value 0");
hashmap1.put("Item 1", "Value 1");
hashmap1.put("Item 2", "Value 2");
hashmap1.put("Item 3", "Value 3");
hashmap1.put("Item 4", "Value 4");
hashmap1.put("Item 5", "Value 5");
hashmap1.put("Item 6", "Value 6");
Set set = hashmap1.entrySet();
Iterator iterator = set.iterator();
while(iterator.hasNext()) {
Map.Entry mapentry = (Map.Entry) iterator.next();
System.out.println(mapentry.getKey() + "/" + mapentry.getValue());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -