标签:set nbsp ring print oid 集合 public auth 世界
package com.yjf.esupplier.common.test; import java.util.Set; import java.util.TreeMap; /** * @author shusheng * @description * @Email shusheng@yiji.com * @date 2018/12/18 13:46 */ public class TreeMapDemo { //键是红黑树结构,可以保证键的排序和唯一性 public static void main(String[] args) { //创建集合对象 TreeMap<String,String> tm = new TreeMap<String,String>(); //添加元素 tm.put("hello", "你好"); tm.put("world", "世界"); tm.put("java", "爪哇"); tm.put("world", "世界2"); tm.put("javaee", "你好ee"); tm.put("aaa", "你好ee"); //遍历集合 Set<String> set = tm.keySet(); for(String key : set){ String value = tm.get(key); System.out.println(key + "---" + value); } } }
标签:set nbsp ring print oid 集合 public auth 世界
原文地址:https://www.cnblogs.com/zuixinxian/p/10341197.html