treemapdemo.java

来自「这是清华大学编写的JAVA教材中所有题目的源代码!」· Java 代码 · 共 29 行

JAVA
29
字号
import java.util.*;

class TreeMapDemo
{
	public static void main(String[] args)
	{
		HashMap hm=new HashMap();
		
		hm.put(new Integer(1),"one");
		hm.put(new Integer(2),"two");
		hm.put(new Integer(3),"three");
		hm.put(new Integer(4),"four");
		hm.put(new Integer(5),"five");
		System.out.println(hm);
		System.out.println();

		

		TreeMap tm=new TreeMap();
		
		tm.put(new Integer(2),"two");
		tm.put(new Integer(4),"four");
		tm.put(new Integer(1),"one");
		tm.put(new Integer(3),"three");
		tm.put(new Integer(5),"five");
		System.out.println(tm);
		System.out.println();
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?