Home > Back-end > Will urban domestic output in alphabetical order, and for the fixed format
Will urban domestic output in alphabetical order, and for the fixed format
Time:10-30
Format: List [ [A] : [{anshan}, {}], [B] : [{baotou}, {}], [C] : [{changping}, {}] ] By analogy, bosses, please provide a train of thought or have code posted for learning how to learn, A rookie, do not spray,
CodePudding user response:
Construct a HashMap, and then sorted by Key, and then the output line, SortedMap Sort=new TreeMap (map);
CodePudding user response:
I'm sorry, just made a mistake, the following is the correct Format: "A list" [ "A" : [{anshan}, {}], "B" : [{baotou}, {}], "C" : [{changping}, {}] ]