Well I have looked into generics and have following question:
List<someClass> list=new List<someClass>
SomeClass MyInstance=SomeClass();
list.Add(MyInstance);
I am not sure what will be added to list - reference or object of reference type (pointing to actual value of MyInstance).
EDIT: Or I will add value (that is reference data type) which points to actual object?
Thanks
When you deal with reference types you are always dealing with references, so a reference will be added to the list (a copy of the reference actually). You don't actually have a choice; that's how the language works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With