7
我将如何去通过嵌套HashMap迭代?通过嵌套HashMap迭代
的HashMap
是设置这样的:
HashMap<String, HashMap<String, Student>>
哪里Student
是包含可变name
的对象。例如如果我的HashMap这个样子(下面是不是我的代码,它只是模拟HashMap中的内容可能是什么)
hm => HashMap<'S', Hashmap<'Sam', SamStudent>>
HashMap<'S', Hashmap<'Seb', SebStudent>>
HashMap<'T', Hashmap<'Thomas', ThomasStudent>>
我怎么能在所有的单字母键的迭代然后每个全名键,然后拔出学生的名字?
完美和最好的代码用于遍历HashMaps这样的包含HashMap。谢谢布雷特 – vkrams 2017-03-11 23:59:50