// 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 Example4.cs // // To run the code after compilation, just run Example4.exe using System; using System.Text; public class Example4 { // 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.Append (" world"); } public static void Main (string[] args) { StringBuilder y = new StringBuilder(); y.Append ("hello"); Foo (y); Console.WriteLine (y); } }