我有一个TreeMap,我想迭代它并打印键值对.但我不想从头开始,我想从一个特定的键值对开始.
基本上我想这样做 -
TreeMap<String, String> treeMap = new TreeMap<String, String>();
//Populate it here
treeMap.get("key1");
//get the iterator to the treemap starting from the key1-value1 pair and iterate
Run Code Online (Sandbox Code Playgroud)
如果我想从头到尾迭代,我知道如何做到这一点,但我没有找到任何答案.