import java.util.Map; import java.util.Set; import java.util.TreeMap; public class MainClass { public static void main(String[] argv) { Map map = new TreeMap(); map.put("key", "value"); map.put("key2", "value2"); map.put("key3", "value3"); Set set = map.keySet(); System.out.println(set); } }
[key, key2, key3]