If I remember correctly even when we pass large string or byte array as a parameter to a method, it only passes the pointer to the heap of the data rather than the full data. So it should not degrade any performance or it should not pile up memory unnecessarily. Just want to confirm if my understanding is correct regarding the above statement?
I know it is better to keep the string or byte array as a private variable in the class and access it in every method it required thus eliminating one additional parameter from the method call.
Thanks
Yes, when you pass any reference type argument, just the reference is passed, by value. Note that this is not the same as “pass by reference”, which is applicable to parameters of both reference types and value types.
See my articles on reference types and value types and parameter passing for more information.
That entirely depends on the context. Is it logically part of the state of the class or not?