Common question but I could use an ‘english’ explanation.
Is it like Java where
Cat myCat
actually is a pointer to Cat?
Should I really create copy constructors in C#?
I understand we are passing by value, but now my question is are we passing by pointer value or full copy of the object?
If it’s the latter, isn’t that too expensive performance/memory wise? Is that when you have to use the ref keyword?
As @rstevens answered, if it is a class, myCat is a reference. But if you pass myCat to a method call, then the reference itself is passed by value – i.e. the parameter itself will reference the same object, but it’s a completely new reference, so if you assign it to null, or create a new object, the old myCat reference will still point to the original object.
Jon Skeet has a good article about it.