I would like to know if by default is Hashtable passed by reference or by value?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In C#, all parameters are passed by value. But
HashTableis a reference type, so the value being passed is a reference to the actualHashTable, if that makes sense.It thus means the HashTable is not being copied when you pass it as a parameter, but if you try to overwrite the parameter value like so:
then it will not work, because you’re overwriting the value parameter, not the actual
HashTable.