namespace testdesignlibrary{ public class test { public static void main() { string s1 = "12345"; string s2 = "12345"; string s3 = "12345"; console.writeline("changing pointer - passed by value:"); console.writeline(s1); referencetypesandparameters.badpasstheobject (s1); console.writeline(s1);
console.writeline("changing pointer - passed by reference:"); console.writeline(s2); referencetypesandparameters.passthereference (ref s2); console.writeline(s2);
console.writeline("passing by return value:"); s3 = referencetypesandparameters.betterthanpassthereference (s3); console.writeline(s3); } }}this example produces the following output.