C#
-
03/19 2차원 배열 2048 구현C#/수업과제 2021. 3. 22. 00:58
Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class A..
-
03/19 수업내용 메모C#/수업내용 2021. 3. 19. 18:18
2021/03/19 튜플 여러 데이터 요소를 그룹화, 값 형식 (int, string) info = (100, "장검"); 분할 클래스(Partial) 둘 이상의 소스파일에 분할 할 수 있음, 코드가 길어질 경우에 사용 대규모 프로젝트에서 작업하는 경우 개별 파일에 분산하면 여러 프로그래머가 동시에 클래스에 대해 작업 가능 명명규칙 : class+기능 확장명 메서드(Extension Method) 기존 형식에 메서드를 추가할 수 있음, 매개변수 앞에 this 한정자가 있음 String.Split메서드 static 형식 자체에 속하는 정적 멤버를 선언, 프로그램 종료시까지 계속 존재 예외처리 예외를 회피하기 위함이 아닌 예측하고 대처하기 위해 사용 throw 예외를 발생시킴String.Split메서드
-
03/19 1차원 2048게임 구현C#/수업내용 2021. 3. 19. 17:06
Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class A..
-
03/18 수업내용 메모C#/수업내용 2021. 3. 19. 09:31
2021/03/17 인터페이스 속성도 정의 가능 IEquatable 인터페이스 Nullable 값 형식 ? null가능 as 형식 테스트 연산자 및 캐스트 식, 변환이 안될경우 null 반환 is 변환될 수 있는경우 true, 될 수 없는 경우 false 캐스트식 (T)E 형태의 캐스트 식은 E 식의 결과를 T 형식으로 명시적으로 변환 typeof연산자 typeof 연산자는 형식의 Systme.Type 인스턴스를 가져옴 Guid.NewGuid 메서드 고유한 아이디 생성 ex) f2f3080b-d27d-4238-a334-889b2a8301fe aa12a2a4-a583-4e61-8d3b-83a62dd25899 ba54a096-6b4b-4f9c-93a4-e4bdbe30a191 이스케이프 문자 줄 바꿈 등에 사..
-
03/18 다차원 배열 연습 2C#/수업내용 2021. 3. 19. 00:48
2번째 행들의 값을 100에서 101로 변경 Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace..
-
03/18 다차원 배열 연습 1C#/수업내용 2021. 3. 19. 00:40
Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class A..
-
03/17 추상클래스, 인터페이스, 속성, 스택, 큐를 사용한 예제C#/수업과제 2021. 3. 18. 01:41
Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { class Program { static void Main(string[] args) { Console.WriteLine("Main"); new App(); } } } App.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Study06 { public class A..
-
03/17 수업내용 메모C#/수업내용 2021. 3. 17. 18:14
2021/03/17 클래스 다이어그램 + public - private # protected interface 기능의 대한 정의가 포함, 정의만 작성, 소스의 동작을 클래스에 포함할 수 있음 상속받은 클래스는 인터페이스에 정의를 전부 구현해야함 하나이상의 인터페이스를 제공할 수 있음 인터페이스는 인스턴스를 만들 수 없음 사용이유 1. 클래스의 여러상속을 지원하지 않기 때문에 2. 구조체에서 상속을 할 수 없기 때문에 명명규칙 I + 형용사 virtual 파생 클래스에서 재정의 가능 오버라이드 구현을 확장하거나 수정 base 파생클래스내에서 기본 클래스의 멤버에 엑세스 abstract 추상클래스를 만드는데 사용, 클래스가 자체에서 인스턴스화되지 않음 추상메서드 선언은 추상클래스에서만 허용,메서드 본문이 없..