(20) C#List and Dictionary Notes

In C# , when two Lists or two Dictionary use = , they refer to the same address and will not be cloned;


List<Card> paiT =newList<Card>(winCard);

 

When a List is constructed from another List , what is generated is a copy of the other List ,

When calling paiT.Remove(winCard[0]) , no matter how many times it is called, it will only be executed once


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324694052&siteId=291194637