c++의 템플릿과 유사한 것
// Declare the generic class. public class GenericList<T> { void Add(T input) { } } class TestGenericList { private class ExampleClass { } static void Main() { // Declare a list of type int. GenericList<int> list1 = new GenericList<int>(); // Declare a list of type string. GenericList<string> list2 = new GenericList<string>(); // Declare a list of type ExampleClass. GenericList<ExampleClass> list3 = new GenericList<ExampleClass>(); } }
'잡다한것들전부 > C#' 카테고리의 다른 글
| 유니티 c# RayCast 디버그 방법(눈으로 디버그라인을 그리는방법) (0) | 2014.01.19 |
|---|---|
| [펌]C# 델리게이트 및 이벤트 함수 (1) | 2014.01.13 |
| [queue] Queue 관련 함수 (Dequeue, Enqueue, Peek) (0) | 2014.01.12 |
| C# 동영상 강의 모은 곳 사이트 주소 (0) | 2014.01.04 |
| c# delegate (0) | 2013.12.30 |
| c# 제네릭 (0) | 2013.12.30 |
Trackback 0 And
Comment 0


