C#
-
delegateC# 2019. 6. 10. 20:45
What is delegate? C# delegate는 C/C++의 함수 포인터와 비슷한 개념으로 메서드 파라미터와 리턴 타입에 대한 정의를 한 후, 동일한 파라미터와 리턴 타입을 가진 메서드를 서로 호환해서 불러 쓸 수 있는 기능이다. delegate: (v)위임하다.(n)대리자 델리게이트의 파라미터와 리턴형식이 위임하는 메서드와 같도록 한다. using System; namespace ConsoleApp133 { class Program { public delegate void del(string s); static void Main() { string s = "Hello"; A a = new A(); del d = new del(a.method); d(s); } } class A { public v..
-
메모리의 특징 이해하기C# 2019. 6. 10. 19:16
The most important 3 parts of Memories are static, stack, heap. static is a blueprint, also called class domain. Value(block value memory, value memory, operation)domain, Heap domain are object creation domain. The important thing is Memory creating structure. Shape sh = new Shape(); Circle cir = new Circle(); In the graphic below, Shape is class type, sh is reference, latter Shape means created..
-
C# polymorphism (2/4) - OverrideC# 2019. 6. 6. 21:06
What is Override? While Overloading is which additionally defining several methods with same name, Overriding is re-defining method of classes that are in relation of inherit. Method of parent class is inherited to child class so that it can be used in child class. In other words, reusing already defined method. At this time, Overriding is not just reusing but re-defining method so that it can c..
-
IndexerC# 2019. 6. 6. 11:00
What is Indexer? Indexer is a structure that makes it possible to deal with class as array by accessing array. Indexer is a structure that makes it possible to deal with class as array by accessing array in object. Indexer is consisted of "get" accessor and "set" accessor just like property. definition of Indexer Indexer is defined as, read only indexer when set accessor is not specified. write ..
-
C# polymorphism (1/4) - OverloadingC# 2019. 6. 5. 19:51
메서드 오버로딩 메서드의 이름은 같지만 아규먼트의 개수나 타입 도는 ref, out, params와 같은 키워드의 유무에 따라 다른 메서드가 생기는데, 이것을 오버로딩(Oberloading)이라 한다. public static void Clear(int[] m) //기존 메서드 { Array.Clear(); } public static void Clear(int[] m, int n) //오버로딩된 메서드 { for (int i = 0; i
-
Stack , HeapC# 2019. 6. 1. 17:36
What is "Stack" -A Memory space to run a program, memory which is needed when calling method is saved here. Stack Frame -A memory for calling method is mandatory in stack. A bundle of memory that are needed for a method is called "Stack Frame". -In other words, each method demands each Stack Frame which is consisted of local value, parameter, return value. Method Call and Stack Memory -When you ..
-
Boxing, UnBoxingC# 2019. 5. 30. 20:44
*Boxing(박싱) Boxing is defined to transforming value type to reference type and data which is in Stack is copied to Heap. In accordance with following example, When interger data int is allocated to object, Boxing automatically occurs. int i = 123; object o = i; //Boxing(implicit transform) integer data '123' is replicated to Heap which object o points. value type is converted to reference type.I..