소스
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace GetSet
{
class MEMBER
{
private string strName;
public string Name
{
// {set; get;}
set
{
Console.WriteLine("Name set 호출");
strName = value;
}
get
{
Console.WriteLine("Name get 호출");
return strName;
}
}
}
class Program
{
static void Main(string[] args)
{
MEMBER m = new MEMBER();
m.Name = "정강원";
Console.WriteLine("이름 : {0}", m.Name);
}
}
}
'프로그래밍 > .NET' 카테고리의 다른 글
| string 메서드 (0) | 2012.08.07 |
|---|---|
| ref, out 키워드 (0) | 2012.08.02 |
| DB 연결(오라클 10g) (0) | 2012.07.30 |
| 프로그램 제어(핸들값 이용) (0) | 2012.07.26 |
| 핸들값 (0) | 2012.07.26 |