interface IAAA
{
int Run();
}
class AAA : IAAA
{
public int Run()
{
return 1;
}
}
class BBB : AAA
{
public int Run()
{
return 2;
}
}
class CCC : AAA
{
public new int Run()
{
return 3;
}
}
static private void func7()
{
var aaa = new AAA();
Console.WriteLine(aaa.Run());
aaa = new BBB();
Console.WriteLine(aaa.Run());
aaa = new CCC();
Console.WriteLine(aaa.Run());
}
/// 출력
1
1
1class override 랑은 다르다
'Develop' 카테고리의 다른 글
| PowerShell - 덤프파일 압축 (0) | 2019.04.29 |
|---|---|
| wpf textbox twoway (0) | 2018.12.13 |
| WPF Binding (0) | 2018.11.12 |
| perforce ignore (0) | 2018.09.05 |
| python AES 암호화 (0) | 2018.05.17 |