[C#] Lec 10 - 델리게이트, 이벤트
예외처리 Try Catch를 이용한 예외 처리 static void Main() { try { int [] arr = new int[]{1, 2, 3}; for (int i = 0; i<4;i++) { Console.WriteLine(arr[i]); } } catch(Exception e) {...
예외처리 Try Catch를 이용한 예외 처리 static void Main() { try { int [] arr = new int[]{1, 2, 3}; for (int i = 0; i<4;i++) { Console.WriteLine(arr[i]); } } catch(Exception e) {...
일반화 프로그래밍 public static T[] CopyArray<T> (T[] source) { T[] array = new T[source.Length]; for (int i = 0; i<source.Length; i++) { array[i] = source[i]; } return array; } publ...
2차원 인덱서를 활용한 Matrix Class는 다음가 같다. public class Matrix { private double[,] data; public double this[int row, int column] { get{return data[row, column];} set{data[row, column]=val...
프로퍼티(property) 프로퍼티의 존재 이유 class MyClass { int myField; public int GetMyField() { return myField; } public void SetMyField(int value) { myField = value; // getter, setter를 따로 구...
인터페이스 인터페이스는 인스턴스를 가질 수 없으며 클래스에서 상속받아 사용함 인터페이스는 멤버로 메소드, 이벤트, 인덱서, 프로퍼티만을 가질 수 있음 (Field)를 가질 수 없음 접근 제한 한정자 (e.g. private, protected)를 가질 수 없고 모든 것이 public으로 선언됨 인터페이스를 상속한 클래스는 인터페이스에...
객체 세상에 존재하는 모든 것은 객체로 표현가능. 객체의 특징은 속성과 기능으로 구분됨. 객체 지향 언어의 특징 캡슐화(Encapsulation) : 데이터(속성)과 알고리즘(기능)을 하나로 묶어 사용하는 것 상속(Inheritance) : 상위 클래스의 모든 것을 하위 클래스가 이어 받는 것. 부모가 자식에게 유전자를 물려주...
열역학 반응, 물리적 변화의 방향을 예측할 수 있음. 가장 안정한 상을 구할 수 있음. Psycial meaning of temperature \[T = ({2\over 3R}) (KE)\] 온도가 높으면 높을 수록 에너지가 큼. 온도 : Random kinetic energy의 한가지 측정방식 계, 주위 Syst...
Liquids Inter-Molecular forces : 분자간 힘 비압축성, Thermal expansion small, diffusion (mobility is limited) → 분자간 힘의 영향 많이 받음 크기 비교 : ion-ion > ion-dipole > dipole-dipole (쌍극자-쌍극자) = dipole-...