I tried to create a list of maps. In the following code, I\'m expecting to get
[{start=1,text=ye}, {start=2,text=no}]
however, I only got
have three adds to the list. the first add is to a new map instance; you never set any values. The second add you pass in a reference to nMap, which has 1, yes. The third add you pass the same reference. So the Map now has 3 references, the first to a map you never added any values to, the next 2 to the same map. which is why you get the same output.