// Example application for code from // https://jonskeet.uk/csharp/parameters.html // // To compile the code, run (from a command prompt // with the appropriate environment variables set): // csc Example3.cs // // To run the code after compilation, just run Example3.exe using System; using System.Text; public class Example3 { // Note that Foo is declared static here just // to make the sample app simple, so we don't // need to instantiate the example class. This // has no bearing on the parameter passing // discussed static void Foo (StringBuilder x) { x = null; } public static void Main (string[] args) { StringBuilder y = new StringBuilder(); y.Append ("hello"); Foo (y); Console.WriteLine (y==null); } }