Home > Back-end >  Map <String, Map <String, Object> how to traverse the data type this
Map <String, Map <String, Object> how to traverse the data type this

Time:10-24

Novice, Map How to traverse the value, the data type for the sample code
Data such as:
20189228={{cc=GDDD, sn=20189228, pp=9 w,}}

CodePudding user response:

 public class TestReg {
Public static void main (String [] args) {
Map map=new HashMap (a);
For (String s: map. The keySet ()) {
Map LittleMap=map. Get (s);
For (String littleStr: littleMap keySet ()) {
System. The out. Println (littleMap. Get (littleStr));
}
}
}
}

CodePudding user response:

Directly using the MAP of the get method

For (String key: map. KeySet ()) {
The map. The get (key)
}

Just here to get the inner layer of map the same way again

CodePudding user response:

Two layers of the for loop problem solving
For (String key: map1 keySet ())
{
The Map map2=map1. Get (key);
For (String key2: map2 keySet ()) {
}
}

CodePudding user response:

Thank you, but if the data "20189228={{cc=GDDD, sn=20189228, pp=9 w,}}" exists in the Obejct first, first Object to map transformation even? How to turn

CodePudding user response:

reference 4 floor csdn_felix3 response:
thank you, but if the data is "20189228={{cc=GDDD, sn=20189228, pp=9 w,}}" exists in the Obejct first, first Object to map transformation even? How to turn

Hello, I am professional do the Java tutorial, enlightening, monthly charge high cost performance, can listen, I am working in Beijing for many years, the current full-time do Java tutorial enlightening, welcome detailed communication must take you learn quickly improve technology
No new xiaoqingfeng008

  • Related