static void Main(string[] args) { Person_GetterSetter p1 = new Person_GetterSetter(); p1.SetName("아이유"); Console.WriteLine(p1.GetName()); Person_Properties p2 = new Person_Properties(); p2.Name = "아이유"; Console.WriteLine(p2.Name); }
static void Main(string[] args) { // getter, setter 사용 Person_GetSet p1 = new Person_GetSet(); p1.SetName("이동윤"); Console.WriteLine(p1.GetName()); // properties 사용 Person_Properties p2 = new Person_Properties(); p2.Name = "이동윤"; Console.WriteLine(p2.Name); }