import java.util.Iterator; import java.util.TreeMap; public class MainClass { public static void main(String[] argv) { TreeMap<String, MyClass> nameToClass; nameToClass = new TreeMap<String, MyClass>(); Iterator<String> nameIter = nameToClass.keySet().iterator(); Iterator<MyClass> classIter = nameToClass.values().iterator(); } } class MyClass { }