[C#] new 키워드(method숨기기)


[C#] new 키워드(method숨기기)

메모리 할당할때 사용하는 new가 아닙니다. 다형성 부분에서 method를 숨길때 사용하는 new 입니다. Colored By Color Scripter 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace method_new_test { class Base { public void method() { Console.WriteLine("Base"); } } class Derived : Base { public new void method() { Console.WriteLine("Derived"); } } class Progr...


#IT·컴퓨터

원문링크 : [C#] new 키워드(method숨기기)