Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why has c# hashtable been changed?
Why has c# hashtable been changed?
Because Hashtable is a reference type, you instantiate a Hashtable newhash in XX method, and then use ht=newhash, that is, let the parameter ht point to the memory address of newhash. Because it is a reference type, the referenced memory address is passed because of newhash. Add("qq ","33 "),//Assign a value to newhash. When calling the xx method in the Load event, indirectly let ht point to the memory address pointed by newhash, so what value newhash has, ht will have (this statement is easy to understand, but not accurate). Understand the difference between string and integer int, reference type and value type, and this problem is easy to understand! The original answer, please indicate the source when reprinting | Copy | CTRL+C | CTRL+V.