CodePudding
Home
front end
Back-end
Net
Software design
Enterprise
Blockchain
Mobile
Software engineering
database
OS
other
Home
>
Back-end
> A List <Map <String, the String> wrong sequence
A List <Map <String, the String> wrong sequence
Time:10-13
I made a loop assignment, but the order is wrong, don't know where there are problems
Public static void main (String [] args)
{
List
Bb=new ArrayList<> (a);
Map
StringStringMap;
for(int i=1; i<=2; I++)
{
StringStringMap=new HashMap<> (a);
for(int j=1; j<=4; J++)
{
StringStringMap. Put (" u "+ I + j," w "+ I + j).
}
Bb. Add (stringStringMap);
}
System. The out. Println (bb);
}
Results:
[{u11=w11, u13=w13, u12=w12, u14=w14}, {u22=w22, u21=w21, u24=w24, u23=w23}]
Page link:
https//www.codepudding.com/Backend/64230.html
Prev:
Using maven in addition to any other main effect management rely on?
Next:
About the type of Java and c # contrast understanding confusion
Tags:
Web development
Related
Links:
CodePudding