예제 #1
0
 static void Modify(Person p)
 {
     if(p != null)
     {
         p.Name = "new name " + p.Name;
     }
 }
예제 #2
0
 static void Main(string []args)
 {
     /*
     string str1 = "aaaa";
     string str2 = "bbbb";
     Swap(ref str1,ref str2);
     Console.WriteLine("str1:{0}, str2:{1}",str1,str2);
     */
     Person p = new Person( ) ;
     p.Name = "zhangsan";
     Modify(p);
     Console.WriteLine(p.Name);
 }