static void Main(string[] args) { while (true) { User user = new User(); user.Age = 5; Test1(ref user); Console.WriteLine(user.Age); Test1(user); Console.WriteLine(user.Age); Console.ReadLine(); test = new Helper().GetTest; Console.WriteLine(test.GetTestString()); Console.WriteLine(test.GetTestString()); Console.WriteLine(test.GetTestString()); if (Console.ReadLine() == "Y") break; } }
static void Test1(ref User user) { user.Age = 100; user = new User(); }