PowerPoint Presentation

Size: px
Start display at page:

Download "PowerPoint Presentation"

Transcription

1

2 C#

3 C# 5.0 1/ C# 과닷넷프레임워크 2/ C# 2.0, 3.0, 4.0, 5.0 정리 3/ 정리및 Q&A

4 C# 과닷넷프레임워크 CIL (1) (Common) Intermediate Language Managed Native IL 기계어 C# C++

5 C# 과닷넷프레임워크 CIL (2) HelloWorld 의 C# / IL 언어 using System; namespace ConsoleApplication1 class Program static void Main(string[] args) Console.WriteLine("Hello World");.assembly extern mscorlib.publickeytoken = (B7 7A 5C E0 89 ).ver 4:0:0:0.assembly helloworld.custom instance void [mscorlib]system.runtime.compilerservices.compilationrelaxationsattribute::.ctor(int32) = ( ).custom instance void [mscorlib]system.runtime.compilerservices.runtimecompatibilityattribute::.ctor() = ( E 6F 6E F 6E F ).hash algorithm 0x ver 0:0:0:0.module helloworld.exe.imagebase 0x file alignment 0x stackreserve 0x subsystem 0x0003.corflags 0x class private auto ansi beforefieldinit ConsoleApplication1.Program extends [mscorlib]system.object.method private hidebysig static void Main(string[] args) cil managed.entrypoint.maxstack 8 IL_0000: nop IL_0001: ldstr "Hello World" IL_0006: call void [mscorlib]system.console::writeline(string) IL_000b: nop IL_000c: ret.method public hidebysig specialname rtspecialname instance void.ctor() cil managed.maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]system.object::.ctor() IL_0006: ret

6 C# 과닷넷프레임워크 CIL (3) 닷넷언어를만드는 2 가지방법 1. 소스코드 CLI 표준에정의된바이너리를직접생성 2. 소스코드 IL 언어 ilasm.exe를이용해서 CLI 표준에정의된바이너리를생성

7 C# 과닷넷프레임워크 CIL (4) IL 에서만가능한표현 표현 IL C# VB.NET 리턴값에따른메서드오버로드 O X X [protected and internal] 접근자 O X X struct에서인자없는생성자정의 O X X

8 C# 과닷넷프레임워크 컴파일 (1) 두번의컴파일 C# 소스코드 중간언어 (Intermediate Language) 기계어 C# 컴파일러 JIT 컴파일러 디버그 릴리즈 디버그 릴리즈

9 C# 과닷넷프레임워크 컴파일 (2) 언어컴파일러 생산된 IL만올바르다면언어의문법은자유롭게확장가능 ex) VB.NET 의 Module에정의되는전역변수 JIT 컴파일러 실행시 IL 코드를 Debug / Release 모드에따라기계어로변환 ex) Field 로정의하면 Property get/set 으로정의하는것보다빠른가? ex) 무한재귀호출이항상 StackOverflowException 을발생할까?

10 C# 과닷넷프레임워크 버전 C# 과닷넷프레임워크버전관계 닷넷버전 C# 버전주요특징 1.0 ~ C# Generics 3.0 ~ LINQ dynamic 예약어 async/await 예약어

11 C# 언어의발전요소 CLR 2.0(4.0) 신규 IL BCL (Base Class Library) 언어표현 - Syntactic Sugar ( 단축표기 ) - 기존의 IL 표현력추가 IL BCL 언어표현 - - -

12 C# 5.0 1/ C# 과닷넷프레임워크 2/ C# 2.0, 3.0, 4.0, 5.0 정리 3/ 정리및 Q&A

13 C# 1.0 VM 언어지만 Interop 을고려 PInvoke, unsafe(pointer), delegate ex) CPU 기계어코드를호출할수있을까? #include "stdafx.h" void getcpuid(int bits[]) _asm xor ebx, ebx; xor ecx, ecx; xor edx, edx; mov eax, 0; cpuid; mov edi, bits; mov dword ptr [edi + 0], eax; mov dword ptr [edi + 4], ebx; mov dword ptr [edi + 8], ecx; mov dword ptr [edi + 12], edx; int _tmain(int argc, _TCHAR* argv[]) int bits[4]; getcpuid(bits); printf("%x, %x, %x, %x\n", bits[0], bits[1], bits[2], bits[3]); return 0;

14 C# 2.0?? 연산자 yield return/break partial class anonymous method static class 제네릭 (Generics) Nullable

15 C# 2.0 -?? 연산자 string txt = null; if (txt == null) Console.WriteLine("(null)"); else Console.WriteLine(txt); string txt = null; Console.WriteLine(txt?? "(null)"); IL BCL 언어표현 - - O

16 C# 2.0 yield return/break (1) IEnumerable 의단축표기 F# C# 주요특징 list IList, ICollection 요소의전체목록을보유 sequence IEnumerable 필요한순간에요소의값을계산 IL BCL 언어표현 - - O

17 C# 2.0 yield return/break (2) IList / ICollection public class ListNatural ArrayList GetNumbers(int max) ArrayList list = new ArrayList(); for (int i = 1; i <= max; i++) list.add(i); return list;

18 C# 2.0 yield return/break (3) IEnumerable public class SequenceNatural : IEnumerable, IEnumerator int _current; public IEnumerator GetEnumerator() _current = 0; return this; public object Current get return _current; public bool MoveNext() _current++; return true; public void Reset() _current = 0;

19 C# 2.0 yield return/break (3) yield return/break public class YieldNatural public IEnumerable GetNumbers() int n = 1; while (true) yield return n; // if (n == 100) yield break; n++;

20 C# 2.0 partial type (1) 클래스의구현을 2 개이상으로분리 partial class MyClass public void Do() Console.Write(_number); partial class MyClass public void Do() Console.Write(_number); partial class MyClass private int _number = 1; private int _number = 1; IL BCL 언어표현 - - O

21 C# 2.0 partial type (2) 자동코드생성의문제점해결! - Visual Studio 2002/ F# 은 WPF 를왜지원하지않는가?

22 C# 2.0 익명메서드 (1) 이름없는메서드정의가능 static void Main(string[] args) Thread t = new Thread(func); t.start(); private static void func(object obj) Console.Write("..."); static void Main(string[] args) Thread t = new Thread( delegate (object obj) Console.Write("..."); ); t.start(); IL BCL 언어표현 - - O

23 C# 2.0 익명메서드 (2) delegate 타입의인자로인라인메서드정의 using System; namespace ConsoleApplication1 class Program delegate void Functor(object obj); static void Main(string[] args) Functor logoutput = delegate(object obj) Console.Write(obj); ; logoutput("test");

24 이벤트처리기 C# 2.0 익명메서드 (3) this.textbox1.textchanged += delegate (object sender, EventArgs e) Console.WriteLine( Do! ); ; // 또는 delegate 의인자를사용하지않는다면생략가능 this.textbox1.textchanged += delegate Console.WriteLine( Do! ); ;

25 C# 2.0 static class IL 코드표현 : 상속불가능한추상클래스 C# 컴파일러 : 인스턴스멤버정의불가능 abstract class AbstractClass.class private abstract auto ansi beforefieldinit AbstractClass extends [mscorlib]system.object.method family hidebysig specialname rtspecialname instance void.ctor() cil managed static class StaticClass.class private abstract auto ansi sealed beforefieldinit StaticClass extends [mscorlib]system.object IL BCL 언어표현 - - O

26 C# 2.0 제네릭 (1) C++ 의 template 과유사 public class NewStack<T> T [] _objlist; int _pos; public NewStack(int size) _objlist = new T[size]; public void Push(T newvalue) _objlist[_pos] = newvalue; _pos++; public T Pop() _pos--; return _objlist[_pos]; IL BCL 언어표현 O - -

27 C# 2.0 제네릭 (2) 메서드수준의제네릭도지원 public class LogOutput public void Output<T,V>(T value1, V value2) Console.WriteLine(value1 + : + value2);

28 C# 2.0 제네릭 (3) 박싱 / 언박싱문제를해결 ArrayList list = new ArrayList(); list.add(5); // void Add(object value) list.add(6); List<int> list = new List<int>(); list.add(5); // void Add(T item) list.add(6); // void Add(int item);

29 제약 1 상속타입 C# 2.0 제네릭 (4) public static T Max<T>(T item1, T item2) where T : IComparable if (item1.compareto(item2) >= 0) return item1; return item2;

30 제약 2 값 / 참조타입 C# 2.0 제네릭 (5) public static void Print<T,V>(T item1, V item2) where T : struct where V : class Console.WriteLine(item1); if (item2!= null) // 값형식인 item1 과비교한다면컴파일에러 Console.WriteLine(item2);

31 C# 2.0 제네릭 (6) 제약 3 인자없는생성자필수 public static T AllocateIfNull<T>(T item) where T : class, new() if (item == null) item = new T(); return item;

32 C# 2.0 제네릭 (7) 기존컬렉션의제네릭버전제공.NET 1.x 컬렉션 ArrayList List<T> 대응되는제네릭버전의컬렉션 Hashtable Dictionary<TKey, TValue> SortedList SortedDictionary<TKey, TValue> Stack Stack<T> Queue Queue<T>

33 C# 2.0 Nullable 타입.NET 2.0 BCL: Nullable<T> 구조체추가 C# 의경우 T? 형태로단축표기 int? value1 = null; short? value2 = 5; // Nullable<int> value1; // Nullable<short> value2; if (value1.hasvalue) Console.WriteLine(value1); Console.WriteLine(value2); // Console.WriteLine(value2.Value); IL BCL 언어표현 - O O

34 C# 5.0 1/ C# 과닷넷프레임워크 2/ C# 2.0, 3.0, 4.0, 5.0 정리 3/ 정리및 Q&A

35 자동구현속성 컬렉션초기화 LINQ var 객체초기화 익명타입 확장메서드 람다식 C# 3.0

36 C# 3.0 자동구현속성 (1) Field + Property 구현을단순화 class Person string _name; public string Name get return _name; set _name = value; int _age; public int Age get return _age; set _age = value; public string Name get; set; public int Age get; set; IL BCL 언어표현 - - O

37 C# 3.0 자동구현속성 (2) get/set 의접근제한자 class Person public string Name get; protected set; public int Age get; private set;

38 C# 3.0 컬렉션초기화 ICollection 인터페이스를구현한타입 컬렉션의요소를 new 구문에서추가 List<int> numbers = new List<int>(); numbers.add(0); numbers.add(1); numbers.add(2); numbers.add(3); numbers.add(4); List<int> numbers = new List<int> 0, 1, 2, 3, 4 ; IL BCL 언어표현 - - O

39 발음 : LINK? LIN-Q? 둘다옳다. C# 3.0 LINQ Moq 도 mock 으로발음하기도하지만 mock u 로발음하는것처럼, 일반적으로 link 라고발음하지만 link u 로발음하기도함. 주의사항 : FAQ 에대해서까지이규칙을적용해서는안됨 ( 출처 :

40 C# 3.0 LINQ (1) LINQ: Language-INtegrated Query 언어에통합된쿼리표현식 (Query Expressions) List<Person> people = new List<Person> new Person Name = "Anders", Age = 47, Married = true, new Person Name = "Hans", Age = 25, Married = false, ; IEnumerable<Person> all = from person in people select person; foreach (Person item in all) Console.WriteLine(item); IL BCL 언어표현 - O O

41 C# 3.0 LINQ (2) SQL 쿼리의 SELECT 와유사 방식 코드 SQL LINQ 메서드 SELECT * FROM people IEnumerable<Person> all = from person in people select person; IEnumerable<Person> SelectFunc(List<Person> people) foreach (Person item in people) yield return item;

42 C# 3.0 var 예약어 컴파일러가로컬변수의형식을추론 C++ 11 의 auto 예약어와동격 IEnumerable<Person> all = from person in people select person; var all = from person in people select person; foreach (var item in all) Console.WriteLine(item); IL BCL 언어표현 - - O

43 C# 3.0 객체초기화 (1) 공용속성을통해객체생성시에초기화 class Person public string Name get; set; public int Age get; set; Person p1 = new Person(); p1.name = Hans ; p1.age = 30; Person p2 = new Person Name = "Tom", Age = 29 ; IL BCL 언어표현 - - O

44 C# 3.0 객체초기화 (2) SELECT * FROM people SELECT Name, Age FROM people SELECT Name, Married FROM people var all = from person in people select person; var all = from person in people select new Person Name = person.name, Age = person.age ; var all = from person in people select new Person Name = person.name, Married = person.married ;

45 C# 3.0 객체초기화 (4) 컬렉션초기화 + 객체초기화 List<Person> list = new List<Person> new Person Name = "Ally", Age = 35, new Person Name = "Luis", Age = 40, ;

46 이름없는타입 C# 3.0 익명타입 (1) 내부적인처리는익명메서드와유사 var 사용은필수 var p = new Count = 10, Title = "Anders" ; Console.WriteLine(p.Title + ": " + p.count); IL BCL 언어표현 - - O

47 LINQ - SELECT C# 3.0 익명타입 (2) var all = from person in people select new Name = person.name, Age = person.age ; var all = from person in people select new Name = person.name, Married = person.married ; foreach (var item in all) Console.WriteLine(item);

48 C# 3.0 익명타입 (3) SELECT p.name, p.age, lang.language FROM people as p INNER JOIN Language as lang ON p.name = lang.name var all = from p in people join lang in languages on p.name equals lang.name select new Name = p.name, Age = p.age, Language = lang.language ; foreach (var item in all) Console.WriteLine(item);

49 C# 3.0 확장메서드 (1) 정적메서드를마치인스턴스메서드처럼사용 class Program static void Main(string[] args) string txt = " string contents = txt.textfromurl(); Console.WriteLine(contents); static class StringExtension public static string TextFromUrl(this string txt) WebClient wc = new WebClient(); return wc.downloadstring(txt); IL BCL 언어표현 - - O

50 C# 3.0 확장메서드 (2) 결국정적메서드호출 class Program static void Main(string[] args) string txt = " string contents = StringExtension.TextFromUrl(txt); Console.WriteLine(contents); static class StringExtension public static string TextFromUrl(string txt) WebClient wc = new WebClient(); return wc.downloadstring(txt);

51 C# 3.0 확장메서드 (3) 쿼리구문과메서드기반구문 var all = from p in people select p; var all = people.select(delegate(person p) return p; ); var all = from p in people select new Name = p.name, Age = p.age ; var all = people.select(delegate(person p) return new Name = p.name, Age = p.age ; );

52 C# 3.0 확장메서드 (4) SELECT * FROM people WHERE Age >= 30 var all = from p in people where p.age >= 30 select p; var all = people.where (delegate(person p) return p.age >= 30; ).Select(delegate(Person p) return p; );

53 C# 3.0 확장메서드 (5) SELECT * FROM people ORDER BY Age var all = from p in people orderby p.age select p; var all = people.orderby(delegate(person p) return p.age; ).Select (delegate(person p) return p; );

54 C# 3.0 람다식 (1) 추론을통해 delegate 익명메서드를개선 delegate void Functor(object obj); Functor logoutput = delegate(object obj) Console.Write(obj); ; Functor loglambda = (obj) => Console.Write(obj); ; IL BCL 언어표현 - - O

55 C# 3.0 람다식 (2) 값반환 + 단문메서드 return+ 중괄호생략 delegate int Calc(int v1, int v2); Calc addfunc = (v1, v2) => return v1 + v2; ; Calc addlambda = (v1, v2) => v1 + v2;

56 C# 3.0 람다식 (3) 메서드기반쿼리를단순화 var all = people.select(delegate(person p) return p; ); var all = people.select(p => p); var all = people.select(delegate(person p) return new Name = p.name, Age = p.age ; ); var all = people.select(p => new Name = p.name, Age = p.age );

57 C# 3.0 람다식 (4) 데이터로써의람다 Expression Tree [ 코드 ] Func<int, int, int> exp = (a, b) => a + b; [ 데이터 ] Expression<Func<int, int, int>> exp = (a, b) => a + b; [mscorlib 어셈블리 ] public delegate TResult Func<T1, T2, TResult>(T1 arg1, T2 arg2)

58 Expression Tree C# 3.0 람다식 (5) // 람다식본체의루트는 2 항연산자인 + 기호 BinaryExpression opplus = exp.body as BinaryExpression; Console.Write(opPlus.NodeType); // 출력 : Add // 2 항연산자의좌측연산자의표현식 ParameterExpression left = opplus.left as ParameterExpression; Console.Write(left.NodeType + ": " + left.name); // 출력 : Parameter: a // 2 항연산자의우측연산자의표현식 ParameterExpression right = opplus.right as ParameterExpression; Console.Write(right.NodeType + ": " + right.name); // 출력 : Parameter: b

59 C# 3.0 람다식 (6) Expression Tree 컴파일 Expression<Func<int, int, int>> exp = (a, b) => a + b; var addfunc = exp.compile(); Console.WriteLine(addFunc(5, 6));

60 C# 3.0 람다식 (7) 사례 1) SQL 쿼리를생성 Expression<Func<IOrderedEnumerable<Person>>> func = () => from p in people orderby p.age descending select p; SELECT * FROM people ORDER BY Age DESC

61 C# 3.0 람다식 (8) 사례 2) 공용속성이름 private int age = 0; public int Age get return age; set age = value; OnPropertyChanged(() => this.age); // OnPropertyChanged( Age ); public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged<TValue>(Expression<Func<TValue>> propertyselector) if (PropertyChanged!= null) var memberexpression = propertyselector.body as MemberExpression; if (memberexpression!= null) PropertyChanged(this, new PropertyChangedEventArgs(memberExpression.Member.Name));

62 LINQ to 표준쿼리연산자 C# 3.0 LINQ 정리

63 C# 5.0 1/ C# 과닷넷프레임워크 2/ C# 2.0, 3.0, 4.0, 5.0 정리 3/ 정리및 Q&A

64 C# 4.0 선택적매개변수 선택적매개변수 명명된인자 dynamic

65 C# 4.0 선택적매개변수 (1) C++ 의디폴트매개변수 class Person public void Output(string name, int age = 0, string address = "Korea") Console.Write(string.Format("0: 1 in 2", name, age, address)); class Program static void Main(string[] args) Person p = new Person(); p.output("anders"); p.output("winnie", 36); p.output("tom", 28, "Tibet"); IL BCL 언어표현 O - -

66 C# 4.0 선택적매개변수 (2) 확장된 IL 구문.method public hidebysig instance void Output(string name, [opt] int32 age, [opt] string address) cil managed.param [2] = int32(0x ).param [3] = "Korea".maxstack 8 IL_0000: nop...[ 생략 ] IL_0019: ret

67 C# 4.0 명명된인자 인자의이름으로호출측에서값전달 class Person public void Output(string name, int age = 0, string address = "Korea") Console.Write(string.Format("0: 1 in 2", name, age, address)); class Program static void Main(string[] args) Person p = new Person(); p.output(address: "Tibet", name: "Tom"); p.output(age: 5, name: "Tom", address: "Tibet"); p.output(name: "Tom"); IL BCL 언어표현 - - O

68 C# 4.0 dynamic (1) 실행시에결정되는타입 using System; namespace ConsoleApplication1 class Program static void Main(string[] args) dynamic d = 5; int sum = d + 10; Console.WriteLine(sum); IL BCL 언어표현 - O O

69 C# 4.0 dynamic (2) 결국은 object 타입 using System; using System.Runtime.CompilerServices; using Microsoft.CSharp.RuntimeBinder; static void Main() dynamic d = 5; d.calltest(); class Program public static CallSite<Action<CallSite, object>> p Site1; static void Main() object d = 5; if (p Site1 == null) p Site1 = CallSite<Action<CallSite, object>>.create( Binder.InvokeMember(CSharpBinderFlags.ResultDiscarded, "CallTest", null, typeof(program), new CSharpArgumentInfo[] CSharpArgumentInfo.Create(CSharpArgumentInfoFlags.None, null) )); p Site1.Target(p Site1, d);

70 C# 4.0 dynamic (3) IronPython 과 C# 1. NuGet 콘솔을열고, 2. Install-Package IronPython 명령어실행 using System; using IronPython.Hosting; class Program static void Main(string[] args) var scriptengine = Python.CreateEngine(); string code print 'Hello Python' "; scriptengine.execute(code); // 'Hello Python' 문자열출력

71 C# 4.0 dynamic (4) C# 에서 IronPython 메서드연동 using System; using IronPython.Hosting; class Program static void Main(string[] args) var scriptengine = Python.CreateEngine(); var scriptscope = scriptengine.createscope(); string code def AddFunc(a, b): print 'AddFunc called' return (a + b) "; scriptengine.execute(code, scriptscope); dynamic addfunc = scriptscope.getvariable("addfunc"); int nresult = addfunc(5, 10); Console.WriteLine(nResult);

72 C# 4.0 dynamic (5) IronPython 에서 C# 메서드연동 using System; using System.Collections.Generic; using IronPython.Hosting; class Program static void Main(string[] args) var scriptengine = Python.CreateEngine(); var scriptscope = scriptengine.createscope(); List<string> list = new List<string>(); scriptscope.setvariable("mylist", list); string code mylist.add('my') mylist.add('python') "; scriptengine.execute(code, scriptscope); foreach (var item in list) Console.WriteLine(item);

73 C# 5.0 1/ C# 과닷넷프레임워크 2/ C# 2.0, 3.0, 4.0, 5.0 정리 3/ 정리및 Q&A

74 C# 5.0 호출자정보 C++ 의 3 가지매크로상수에대응 FUNCTION, FILE, LINE, using System; using System.Runtime.CompilerServices; class Program static void Main(string[] args) LogMessage(" 테스트로그 "); static void LogMessage(string text, [CallerMemberName] string member = "", [CallerFilePath] string file = "", [CallerLineNumber] int line = 0) Console.WriteLine(" 텍스트 : " + text); Console.WriteLine(" 호출한메서드이름 : " + member); Console.WriteLine(" 호출한소스코드의파일명 : " + file); Console.WriteLine(" 호출한소스코드의라인번호 : " + line); IL BCL 언어표현 - O O

75 C# 5.0 async/await (1) 마치동기방식처럼비동기호출 private static async void AwaitRead() using (FileStream fs = new FileStream(@" ", FileMode.Open)) byte[] buf = new byte[fs.length]; await fs.readasync(buf, 0, buf.length); string txt = Encoding.UTF8.GetString(buf); Console.WriteLine(txt); static void Main(string[] args) AwaitRead() Console.ReadLine(); IL BCL 언어표현 - O O

76 C# 5.0 async/await (2) 비동기호출시스레드상태

77 C# 5.0 async/await (3) 사용자정의 Async 메서드 private static async void FileReadAsync(string filepath) string filetext = await ReadAllTextAsync(filePath); Console.WriteLine(fileText); static Task<string> ReadAllTextAsync(string filepath) return Task.Factory.StartNew(() => return File.ReadAllText(filePath); );

78 C# 5.0 1/ C# 과닷넷프레임워크 2/ C# 2.0, 3.0, 4.0, 5.0 정리 3/ 정리및 Q&A

79 정리 단축표기법 방식 수 신규 IL 2 BCL 확장 5 언어확장 18 C# 6.0? Roslyn?

선형대수학 Linear Algebra

선형대수학  Linear Algebra 배열, 컬렉션, 인덱서 array, collection, indexer 소프트웨어학과 HCI 프로그래밍강좌 배열 배열 (array) 동일한자료형을다수선언 선언형식 데이터형식 [ ] 배열이름 = new 데이터형식 [ 개수 ]; int[ ] array = new int[5]; 인덱스 (index) 는 0 에서시작 scores[0] = 80; scores[1] =

More information

C# Programming Guide - Types

C# Programming Guide - Types C# Programming Guide - Types 최도경 lifeisforu@wemade.com 이문서는 MSDN 의 Types 를요약하고보충한것입니다. http://msdn.microsoft.com/enus/library/ms173104(v=vs.100).aspx Types, Variables, and Values C# 은 type 에민감한언어이다. 모든

More information

LINQ의 개요

LINQ의 개요 LINQ 의개요 이수겸 @ 올랩컨설팅 K E N I A L L E E _ A T _ G M A I L. C O M H T T P : / / K E N I A L. T I S T O R Y. C O M 2 0 0 7. 1 0. 6 LINQ.NET Language-INtegrated Query.NET 프레임워크 3.5, Visual Studio 2 008(Orcas)

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 클래스, 객체, 메소드 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 필드만있는클래스 텔레비젼 2 예제 1. 필드만있는클래스 3 예제 2. 여러개의객체생성하기 4 5 예제 3. 메소드가추가된클래스 public class Television { int channel; // 채널번호 int volume; // 볼륨 boolean

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 2... ( ). ( ). @ vs. logic data method variable behavior attribute method field Flow (Type), ( ) member @ () : C program Method A ( ) Method B ( ) Method C () program : Java, C++, C# data @ Program

More information

Microsoft PowerPoint - CSharp-2-기초문법

Microsoft PowerPoint - CSharp-2-기초문법 2 장. C# 기초문법 자료형 제어문 배열 연산자 순천향대학교컴퓨터학부이상정 1 자료형 순천향대학교컴퓨터학부이상정 2 CTS CTS(Common Type System) 닷넷기반의여러언어에서공통으로사용되는자료형 언어별로서로다른자료형을사용할때발생할수있는호환성문제를해결 값 (Value) 형과참조 (Reference) 형을지원 CTS가제공하는모든자료형은 System.Object를상속받아구현

More information

Deok9_Exploit Technique

Deok9_Exploit Technique Exploit Technique CodeEngn Co-Administrator!!! and Team Sur3x5F Member Nick : Deok9 E-mail : DDeok9@gmail.com HomePage : http://deok9.sur3x5f.org Twitter :@DDeok9 > 1. Shell Code 2. Security

More information

초보자를 위한 C# 21일 완성

초보자를 위한 C# 21일 완성 C# 21., 21 C#., 2 ~ 3 21. 2 ~ 3 21.,. 1~ 2 (, ), C#.,,.,., 21..,.,,, 3. A..,,.,.. Q&A.. 24 C#,.NET.,.,.,. Visual C# Visual Studio.NET,..,. CD., www. TeachYour sel f CSharp. com., ( )., C#.. C# 1, 1. WEEK

More information

JAVA PROGRAMMING 실습 08.다형성

JAVA PROGRAMMING 실습 08.다형성 2015 학년도 2 학기 1. 추상메소드 선언은되어있으나코드구현되어있지않은메소드 abstract 키워드사용 메소드타입, 이름, 매개변수리스트만선언 public abstract String getname(); public abstract void setname(string s); 2. 추상클래스 abstract 키워드로선언한클래스 종류 추상메소드를포함하는클래스

More information

hlogin2

hlogin2 0x02. Stack Corruption off-limit Kernel Stack libc Heap BSS Data Code off-limit Kernel Kernel : OS Stack libc Heap BSS Data Code Stack : libc : Heap : BSS, Data : bss Code : off-limit Kernel Kernel : OS

More information

<4D F736F F F696E74202D20C1A63038C0E520C5ACB7A1BDBABFCD20B0B4C3BC4928B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

<4D F736F F F696E74202D20C1A63038C0E520C5ACB7A1BDBABFCD20B0B4C3BC4928B0ADC0C729205BC8A3C8AF20B8F0B5E55D> Power Java 제 8 장클래스와객체 I 이번장에서학습할내용 클래스와객체 객체의일생직접 메소드클래스를 필드작성해 UML 봅시다. QUIZ 1. 객체는 속성과 동작을가지고있다. 2. 자동차가객체라면클래스는 설계도이다. 먼저앞장에서학습한클래스와객체의개념을복습해봅시다. 클래스의구성 클래스 (class) 는객체의설계도라할수있다. 클래스는필드와메소드로이루어진다.

More information

Microsoft PowerPoint - CSharp-10-예외처리

Microsoft PowerPoint - CSharp-10-예외처리 10 장. 예외처리 예외처리개념 예외처리구문 사용자정의예외클래스와예외전파 순천향대학교컴퓨터학부이상정 1 예외처리개념 순천향대학교컴퓨터학부이상정 2 예외처리 오류 컴파일타임오류 (Compile-Time Error) 구문오류이기때문에컴파일러의구문오류메시지에의해쉽게교정 런타임오류 (Run-Time Error) 디버깅의절차를거치지않으면잡기어려운심각한오류 시스템에심각한문제를줄수도있다.

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 3 if, if else, if else if, switch case for, while, do while break, continue : System.in, args, JOptionPane for (,, ) @ vs. logic data method variable Data Data Flow (Type), ( ) @ Member field

More information

02 C h a p t e r Java

02 C h a p t e r Java 02 C h a p t e r Java Bioinformatics in J a va,, 2 1,,,, C++, Python, (Java),,, (http://wwwbiojavaorg),, 13, 3D GUI,,, (Java programming language) (Sun Microsystems) 1995 1990 (green project) TV 22 CHAPTER

More information

Microsoft PowerPoint - C++ 5 .pptx

Microsoft PowerPoint - C++ 5 .pptx C++ 언어프로그래밍 한밭대학교전자. 제어공학과이승호교수 연산자중복 (operator overloading) 이란? 2 1. 연산자중복이란? 1) 기존에미리정의되어있는연산자 (+, -, /, * 등 ) 들을프로그래머의의도에맞도록새롭게정의하여사용할수있도록지원하는기능 2) 연산자를특정한기능을수행하도록재정의하여사용하면여러가지이점을가질수있음 3) 하나의기능이프로그래머의의도에따라바뀌어동작하는다형성

More information

PowerPoint Presentation

PowerPoint Presentation Class - Property Jo, Heeseung 목차 section 1 클래스의일반구조 section 2 클래스선언 section 3 객체의생성 section 4 멤버변수 4-1 객체변수 4-2 클래스변수 4-3 종단 (final) 변수 4-4 멤버변수접근방법 section 5 멤버변수접근한정자 5-1 public 5-2 private 5-3 한정자없음

More information

Design Issues

Design Issues 11 COMPUTER PROGRAMMING INHERIATANCE CONTENTS OVERVIEW OF INHERITANCE INHERITANCE OF MEMBER VARIABLE RESERVED WORD SUPER METHOD INHERITANCE and OVERRIDING INHERITANCE and CONSTRUCTOR 2 Overview of Inheritance

More information

Microsoft PowerPoint - hci2-lecture12 [호환 모드]

Microsoft PowerPoint - hci2-lecture12 [호환 모드] Serialization C# Serialization 321190 2012 년가을학기 11/28/2012 박경신 Serializaiton( 직렬화 ) 란객체상태를지속시키거나전송할수있는형식으로변환하는과정으로, Serialization 반대로다시객체로변환하는것을 Deserialization 임 Serialization i 을사용하는이유 객체의상태를저장소에보존했다가나중에똑같은복사본을다시만들기위하거나,

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 제 3 장함수와문자열 1. 함수의기본적인개념을이해한다. 2. 인수와매개변수의개념을이해한다. 3. 함수의인수전달방법 2가지를이해한다 4. 중복함수를이해한다. 5. 디폴트매개변수를이해한다. 6. 문자열의구성을이해한다. 7. string 클래스의사용법을익힌다. 이번장에서만들어볼프로그램 함수란? 함수선언 함수호출 예제 #include using

More information

JAVA PROGRAMMING 실습 05. 객체의 활용

JAVA PROGRAMMING 실습 05. 객체의 활용 public class Person{ public String name; public int age; } public Person(){ } public Person(String s, int a){ name = s; age = a; } public String getname(){ return name; } @ 객체의선언 public static void main(string

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 인터페이스, 람다식, 패키지 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 홈네트워킹 public interface RemoteControl { public void turnon(); // 가전제품을켠다. public void turnoff(); // 가전제품을끈다. 인터페이스를구현 public class Television

More information

강의10

강의10 Computer Programming gdb and awk 12 th Lecture 김현철컴퓨터공학부서울대학교 순서 C Compiler and Linker 보충 Static vs Shared Libraries ( 계속 ) gdb awk Q&A Shared vs Static Libraries ( 계속 ) Advantage of Using Libraries Reduced

More information

JVM 메모리구조

JVM 메모리구조 조명이정도면괜찮조! 주제 JVM 메모리구조 설미라자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조장. 최지성자료조사, 자료작성, PPT 작성, 보고서작성. 발표. 조원 이용열자료조사, 자료작성, PPT 작성, 보고서작성. 이윤경 자료조사, 자료작성, PPT작성, 보고서작성. 이수은 자료조사, 자료작성, PPT작성, 보고서작성. 발표일 2013. 05.

More information

JAVA PROGRAMMING 실습 02. 표준 입출력

JAVA PROGRAMMING 실습 02. 표준 입출력 # 왜생겼나요..? : 절차지향언어가가진단점을보완하고다음의목적을달성하기위해..! 1. 소프트웨어생산성향상 객체지향소프트웨어를새로만드는경우이미만든개체지향소프트웨어를상속받거나객체를 가져다재사용할수있어부분수정을통해소프트웨어를다시만드는부담줄임. 2. 실세계에대한쉬운모델링 실세계의일은절차나과정보다는일과관련된많은물체들의상호작용으로묘사. 캡슐화 메소드와데이터를클래스내에선언하고구현

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 4 (Object) (Class) (Instance) (Method) (Constructor) Memory 1 UML 1 @ & 1 (Real World) (Software World) @ &.. () () @ & 2 (Real World) (Software World) OOA/ Modeling Abstraction Instantiation

More information

gnu-lee-oop-kor-lec06-3-chap7

gnu-lee-oop-kor-lec06-3-chap7 어서와 Java 는처음이지! 제 7 장상속 Super 키워드 상속과생성자 상속과다형성 서브클래스의객체가생성될때, 서브클래스의생성자만호출될까? 아니면수퍼클래스의생성자도호출되는가? class Base{ public Base(String msg) { System.out.println("Base() 생성자 "); ; class Derived extends Base

More information

비긴쿡-자바 00앞부속

비긴쿡-자바 00앞부속 IT COOKBOOK 14 Java P r e f a c e Stay HungryStay Foolish 3D 15 C 3 16 Stay HungryStay Foolish CEO 2005 L e c t u r e S c h e d u l e 1 14 PPT API C A b o u t T h i s B o o k IT CookBook for Beginner Chapter

More information

JAVA PROGRAMMING 실습 02. 표준 입출력

JAVA PROGRAMMING 실습 02. 표준 입출력 자바의기본구조? class HelloJava{ public static void main(string argv[]){ system.out.println( hello,java ~ ){ } } # 하나하나뜯어살펴봅시다! public class HelloJava{ 클래스정의 public static void main(string[] args){ System.out.println(

More information

예제 2) Test.java class A intvar= 10; void method() class B extends A intvar= 20; 1"); void method() 2"); void method1() public class Test 3"); args) A

예제 2) Test.java class A intvar= 10; void method() class B extends A intvar= 20; 1); void method() 2); void method1() public class Test 3); args) A 제 10 장상속 예제 1) ConstructorTest.java class Parent public Parent() super - default"); public Parent(int i) this("hello"); super(int) constructor" + i); public Parent(char c) this(); super(char) constructor

More information

Microsoft PowerPoint - 04-UDP Programming.ppt

Microsoft PowerPoint - 04-UDP Programming.ppt Chapter 4. UDP Dongwon Jeong djeong@kunsan.ac.kr http://ist.kunsan.ac.kr/ Dept. of Informatics & Statistics 목차 UDP 1 1 UDP 개념 자바 UDP 프로그램작성 클라이언트와서버모두 DatagramSocket 클래스로생성 상호간통신은 DatagramPacket 클래스를이용하여

More information

1. 객체의생성과대입 int 형변수 : 선언과동시에초기화하는방법 (C++) int a = 3; int a(3); // 기본타입역시클래스와같이처리가능 객체의생성 ( 복습 ) class CPoint private : int x, y; public : CPoint(int a

1. 객체의생성과대입 int 형변수 : 선언과동시에초기화하는방법 (C++) int a = 3; int a(3); // 기본타입역시클래스와같이처리가능 객체의생성 ( 복습 ) class CPoint private : int x, y; public : CPoint(int a 6 장복사생성자 객체의생성과대입객체의값에의한전달복사생성자디폴트복사생성자복사생성자의재정의객체의값에의한반환임시객체 C++ 프로그래밍입문 1. 객체의생성과대입 int 형변수 : 선언과동시에초기화하는방법 (C++) int a = 3; int a(3); // 기본타입역시클래스와같이처리가능 객체의생성 ( 복습 ) class CPoint private : int x, y;

More information

자바 프로그래밍

자바 프로그래밍 5 (kkman@mail.sangji.ac.kr) (Class), (template) (Object) public, final, abstract [modifier] class ClassName { // // (, ) Class Circle { int radius, color ; int x, y ; float getarea() { return 3.14159

More information

chap10.PDF

chap10.PDF 10 C++ Hello!! C C C++ C++ C++ 2 C++ 1980 Bell Bjarne Stroustrup C++ C C++ C, C++ C C 3 C C++ (prototype) (type checking) C C++ : C++ 4 C C++ (prototype) (type checking) [ 10-1] #include extern

More information

Modern Javascript

Modern Javascript ES6 - Arrow Function Class Template String Destructuring Default, Rest, Spread let, const for..of Promises Module System Map, Set * Generator * Symbol * * https://babeljs.io/ Babel is a JavaScript compiler.

More information

07 자바의 다양한 클래스.key

07 자바의 다양한 클래스.key [ 07 ] . java.lang Object, Math, String, StringBuffer Byte, Short, Integer, Long, Float, Double, Boolean, Character. java.util Random, StringTokenizer Calendar, GregorianCalendar, Date. Collection, List,

More information

* Factory class for query and DML clause creation * tiwe * */ public class JPAQueryFactory implements JPQLQueryFactory private f

* Factory class for query and DML clause creation * tiwe * */ public class JPAQueryFactory implements JPQLQueryFactory private f JPA 에서 QueryDSL 사용하기위해 JPAQuery 인스턴스생성방법 http://ojc.asia, http://ojcedu.com 1. JPAQuery 를직접생성하기 JPAQuery 인스턴스생성하기 QueryDSL의 JPAQuery API를사용하려면 JPAQuery 인스턴스를생성하면된다. // entitymanager는 JPA의 EntityManage

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 인터페이스 배효철 th1g@nate.com 1 목차 인터페이스의역할 인터페이스선언 인터페이스구현 인터페이스사용 타입변환과다형성 인터페이스상속 디폴트메소드와인터페이스확장 2 인터페이스의역할 인터페이스란? 개발코드와객체가서로통신하는접점 개발코드는인터페이스의메소드만알고있으면 OK 인터페이스의역할 개발코드가객체에종속되지않게 -> 객체교체할수있도록하는역할 개발코드변경없이리턴값또는실행내용이다양해질수있음

More information

슬라이드 1

슬라이드 1 -Part3- 제 4 장동적메모리할당과가변인 자 학습목차 4.1 동적메모리할당 4.1 동적메모리할당 4.1 동적메모리할당 배울내용 1 프로세스의메모리공간 2 동적메모리할당의필요성 4.1 동적메모리할당 (1/6) 프로세스의메모리구조 코드영역 : 프로그램실행코드, 함수들이저장되는영역 스택영역 : 매개변수, 지역변수, 중괄호 ( 블록 ) 내부에정의된변수들이저장되는영역

More information

<4D F736F F F696E74202D2036C0CFC2B05FB0B4C3BCC1F6C7E2C7C1B7CEB1D7B7A1B9D62E707074>

<4D F736F F F696E74202D2036C0CFC2B05FB0B4C3BCC1F6C7E2C7C1B7CEB1D7B7A1B9D62E707074> 객체지향프로그램밍 (Object-Oriented Programming) 1 C++ popular C 객체지향 (object oriented) C++ C : 상위계층언어특징 + 어셈블리언어특징 C++ : 소프트웨어개발플랫폼에객체지향개념제공 객체지향 : 자료와이들자료를어떻게다룰것인지따로생각하지않고단지하나의사물로생각 형 변수가사용하는메모리크기 변수가가질수있는정보

More information

(Microsoft PowerPoint - hci2-lecture12 [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - hci2-lecture12 [\310\243\310\257 \270\360\265\345]) Serialization C# Serialization 321190 2015 년가을학기 11/27/2015 박경신 Serializaiton( 직렬화 ) 란객체상태를지속시키거나전송할수있는형식으로변환하는과정으로, Serialization 반대로다시객체로변환하는것을 Deserialization 임 Serialization 을사용하는이유 객체의상태를저장소에보존했다가나중에똑같은복사본을다시만들기위하거나,

More information

슬라이드 1

슬라이드 1 UNIT 16 예외처리 로봇 SW 교육원 3 기 최상훈 학습목표 2 예외처리구문 try-catch-finally 문을사용핛수있다. 프로그램오류 3 프로그램오류의종류 컴파일에러 (compile-time error) : 컴파일실행시발생 럮타임에러 (runtime error) : 프로그램실행시발생 에러 (error) 프로그램코드에의해서해결될수없는심각핚오류 ex)

More information

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형 바에 제네릭스(generics)를 도입하기 위한 연구는 이미 8년 전인 1996년부터라고 한다. 실제로 자바에 제네릭스를 도입하 는 몇 가지 방안들이 논문으로 나오기 시작한 것이 1998년 초임을 감 안하면 무려 8년이 지난 후에야 자바 5.0에 전격 채택되었다는 것은 이것이 얼마나 어려운 일이었나 하는 것을 보여준다. 자바의 스펙을 결정하는 표준화 절차인

More information

PowerPoint Presentation

PowerPoint Presentation 자바프로그래밍 1 클래스와메소드심층연구 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 접근제어 class A { private int a; int b; public int c; // 전용 // 디폴트 // 공용 public class Test { public static void main(string args[]) { A obj = new

More information

Microsoft PowerPoint - additional01.ppt [호환 모드]

Microsoft PowerPoint - additional01.ppt [호환 모드] 1.C 기반의 C++ part 1 함수 오버로딩 (overloading) 디폴트매개변수 (default parameter) 인-라인함수 (in-line function) 이름공간 (namespace) Jong Hyuk Park 함수 Jong Hyuk Park 함수오버로딩 (overloading) 함수오버로딩 (function overloading) C++ 언어에서는같은이름을가진여러개의함수를정의가능

More information

3ÆÄÆ®-14

3ÆÄÆ®-14 chapter 14 HTTP >>> 535 Part 3 _ 1 L i Sting using System; using System.Net; using System.Text; class DownloadDataTest public static void Main (string[] argv) WebClient wc = new WebClient(); byte[] response

More information

No Slide Title

No Slide Title Copyright, 2017 Multimedia Lab., UOS 시스템프로그래밍 (Assembly Code and Calling Convention) Seong Jong Choi chois@uos.ac.kr Multimedia Lab. Dept. of Electrical and Computer Eng. University of Seoul Seoul, Korea

More information

61 62 63 64 234 235 p r i n t f ( % 5 d :, i+1); g e t s ( s t u d e n t _ n a m e [ i ] ) ; if (student_name[i][0] == \ 0 ) i = MAX; p r i n t f (\ n :\ n ); 6 1 for (i = 0; student_name[i][0]!= \ 0&&

More information

제11장 프로세스와 쓰레드

제11장 프로세스와 쓰레드 제9장자바쓰레드 9.1 Thread 기초 (1/5) 프로그램 명령어들의연속 (a sequence of instruction) 프로세스 / Thread 실행중인프로그램 (program in execution) 프로세스생성과실행을위한함수들 자바 Thread 2 9.1 Thread 기초 (2/5) 프로세스단위작업의문제점 프로세스생성시오버헤드 컨텍스트스위치오버헤드

More information

12 C# 7.0 C# 6.0의경우컴파일러를완전히새롭게만드는작업으로인해이전버전대비중대한문법향상이없었던반면 C# 7.0부터는다시주요한변화를이끌어내기시작했는데바로함수형언어에서나제공하던패턴매칭구문을가능하게했다는점이다. 물론 C# 7.0에서는그밖의소소한간편표기구문도제공한다.

12 C# 7.0 C# 6.0의경우컴파일러를완전히새롭게만드는작업으로인해이전버전대비중대한문법향상이없었던반면 C# 7.0부터는다시주요한변화를이끌어내기시작했는데바로함수형언어에서나제공하던패턴매칭구문을가능하게했다는점이다. 물론 C# 7.0에서는그밖의소소한간편표기구문도제공한다. 12 C# 7.0 C# 6.0의경우컴파일러를완전히새롭게만드는작업으로인해이전버전대비중대한문법향상이없었던반면 C# 7.0부터는다시주요한변화를이끌어내기시작했는데바로함수형언어에서나제공하던패턴매칭구문을가능하게했다는점이다. 물론 C# 7.0에서는그밖의소소한간편표기구문도제공한다. C# 7.0에대응하는닷넷프레임워크의버전은 4.7이고, 주요개발환경은비주얼스튜디오 2017이다.

More information

01-OOPConcepts(2).PDF

01-OOPConcepts(2).PDF Object-Oriented Programming Concepts Tel: 02-824-5768 E-mail: hhcho@selabsoongsilackr? OOP (Object) (Encapsulation) (Message) (Class) (Inheritance) (Polymorphism) (Abstract Class) (Interface) 2 1 + = (Dependency)

More information

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사) Java Program Performance Tuning ( ) n (Primes0) static List primes(int n) { List primes = new ArrayList(n); outer: for (int candidate = 2; n > 0; candidate++) { Iterator iter = primes.iterator(); while

More information

OCaml

OCaml OCaml 2009.. (khheo@ropas.snu.ac.kr) 1 ML 2 ML OCaml INRIA, France SML Bell lab. & Princeton, USA nml SNU/KAIST, KOREA 3 4 (let) (* ex1.ml *) let a = 10 let add x y = x + y (* ex2.ml *) let sumofsquare

More information

PowerPoint Presentation

PowerPoint Presentation public class SumTest { public static void main(string a1[]) { int a, b, sum; a = Integer.parseInt(a1[0]); b = Integer.parseInt(a1[1]); sum = a + b ; // 두수를더하는부분입니다 System.out.println(" 두수의합은 " + sum +

More information

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100 2015-1 프로그래밍언어 9. 연결형리스트, Stack, Queue 2015 년 5 월 4 일 교수김영탁 영남대학교공과대학정보통신공학과 (Tel : +82-53-810-2497; Fax : +82-53-810-4742 http://antl.yu.ac.kr/; E-mail : ytkim@yu.ac.kr) 연결리스트 (Linked List) 연결리스트연산 Stack

More information

Tcl의 문법

Tcl의 문법 월, 01/28/2008-20:50 admin 은 상당히 단순하고, 커맨드의 인자를 스페이스(공백)로 단락을 짓고 나열하는 정도입니다. command arg1 arg2 arg3... 한행에 여러개의 커맨드를 나열할때는, 세미콜론( ; )으로 구분을 짓습니다. command arg1 arg2 arg3... ; command arg1 arg2 arg3... 한행이

More information

어댑터뷰

어댑터뷰 04 커스텀어댑터뷰 (Custom Adapter View) 커스텀어댑터뷰 (Custom Adapter View) 커스텀어댑터뷰 (Custom Adatper View) 란? u 어댑터뷰의항목하나는단순한문자열이나이미지뿐만아니라, 임의의뷰가될수 있음 이미지뷰 u 커스텀어댑터뷰설정절차 1 2 항목을위한 XML 레이아웃정의 어댑터정의 3 어댑터를생성하고어댑터뷰객체에연결

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 Power Java 제 11 장상속 이번장에서학습할내용 상속이란? 상속의사용 메소드재정의 접근지정자 상속과생성자 Object 클래스 종단클래스 상속을코드를재사용하기위한중요한기법입니다. 상속이란? 상속의개념은현실세계에도존재한다. 상속의장점 상속의장점 상속을통하여기존클래스의필드와메소드를재사용 기존클래스의일부변경도가능 상속을이용하게되면복잡한 GUI 프로그램을순식간에작성

More information

- 목차 - - ios 개발환경및유의사항. - 플랫폼 ios Project. - Native Controller와플랫폼화면연동. - 플랫폼 Web(js)-Native 간데이터공유. - 플랫폼확장 WN Interface 함수개발. - Network Manager clas

- 목차 - - ios 개발환경및유의사항. - 플랫폼 ios Project. - Native Controller와플랫폼화면연동. - 플랫폼 Web(js)-Native 간데이터공유. - 플랫폼확장 WN Interface 함수개발. - Network Manager clas 플랫폼사용을위한 ios Native Guide - 목차 - - ios 개발환경및유의사항. - 플랫폼 ios Project. - Native Controller와플랫폼화면연동. - 플랫폼 Web(js)-Native 간데이터공유. - 플랫폼확장 WN Interface 함수개발. - Network Manager class 개발. - Native Controller에서

More information

C 프로그래밍 언어 입문 C 프로그래밍 언어 입문 김명호저 숭실대학교 출판국 머리말..... C, C++, Java, Fortran, Python, Ruby,.. C. C 1972. 40 C.. C. 1999 C99. C99. C. C. C., kmh ssu.ac.kr.. ,. 2013 12 Contents 1장 프로그래밍 시작 1.1 C 10 1.2 12

More information

PowerPoint Presentation

PowerPoint Presentation public class SumTest { public static void main(string a1[]) { int a, b, sum; a = Integer.parseInt(a1[0]); b = Integer.parseInt(a1[1]); sum = a + b ; // 두수를더하는부분입니다 System.out.println(" 두수의합은 " + sum +

More information

5장.key

5장.key JAVA Programming 1 (inheritance) 2!,!! 4 3 4!!!! 5 public class Person {... public class Student extends Person { // Person Student... public class StudentWorker extends Student { // Student StudentWorker...!

More information

Microsoft PowerPoint - a10.ppt [호환 모드]

Microsoft PowerPoint - a10.ppt [호환 모드] Structure Chapter 10: Structures t and Macros Structure 관련된변수들의그룹으로이루어진자료구조 template, pattern field structure를구성하는변수 (cf) C언어의 struct 프로그램의 structure 접근 entire structure 또는 individual fields Structure는

More information

ThisJava ..

ThisJava .. 자바언어에정확한타입을추가한 ThisJava 소개 나현익, 류석영 프로그래밍언어연구실 KAIST 2014 년 1 월 14 일 나현익, 류석영 자바언어에정확한타입을추가한 ThisJava 소개 1/29 APLAS 2013 나현익, 류석영 자바 언어에 정확한 타입을 추가한 ThisJava 소개 2/29 실제로부딪힌문제 자바스크립트프로그램분석을위한요약도메인 나현익,

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 Power Java 제 9 장생성자와접근제어 이번장에서학습할내용 생성자 정적변수 정적메소드 접근제어 this 클래스간의관계 객체가생성될때초기화를담당하는생성자에대하여살펴봅니다. 생성자 생성자 (contructor): 객체가생성될때에필드에게초기값을제공하고필요한초기화절차를실행하는메소드 생성자의예 class Car { private String color; // 색상

More information

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

@OneToOne(cascade = = addr_id) private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a 1 대 1 단방향, 주테이블에외래키실습 http://ojcedu.com, http://ojc.asia STS -> Spring Stater Project name : onetoone-1 SQL : JPA, MySQL 선택 http://ojc.asia/bbs/board.php?bo_table=lecspring&wr_id=524 ( 마리아 DB 설치는위 URL

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 실습 1 배효철 th1g@nate.com 1 목차 조건문 반복문 System.out 구구단 모양만들기 Up & Down 2 조건문 조건문의종류 If, switch If 문 조건식결과따라중괄호 { 블록을실행할지여부결정할때사용 조건식 true 또는 false값을산출할수있는연산식 boolean 변수 조건식이 true이면블록실행하고 false 이면블록실행하지않음 3

More information

q 이장에서다룰내용 1 객체지향프로그래밍의이해 2 객체지향언어 : 자바 2

q 이장에서다룰내용 1 객체지향프로그래밍의이해 2 객체지향언어 : 자바 2 객체지향프로그래밍 IT CookBook, 자바로배우는쉬운자료구조 q 이장에서다룰내용 1 객체지향프로그래밍의이해 2 객체지향언어 : 자바 2 q 객체지향프로그래밍의이해 v 프로그래밍기법의발달 A 군의사업발전 1 단계 구조적프로그래밍방식 3 q 객체지향프로그래밍의이해 A 군의사업발전 2 단계 객체지향프로그래밍방식 4 q 객체지향프로그래밍의이해 v 객체란무엇인가

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 제 11 장상속 1. 상속의개념을이해한다. 2. 상속을이용하여자식클래스를작성할수있다. 3. 상속과접근지정자와의관계를이해한다. 4. 상속시생성자와소멸자가호출되는순서를이해한다. 이번장에서만들어볼프로그램 class Circle { int x, y; int radius;... class Rect { int x, y; int width, height;... 중복 상속의개요

More information

<4D F736F F D20BEBEBCA520C4DAB5F920BFACBDC0202D20B8D6C6BC20BEB2B7B9B5E5BFCD20C0CCBAA5C6AE2E646F6378>

<4D F736F F D20BEBEBCA520C4DAB5F920BFACBDC0202D20B8D6C6BC20BEB2B7B9B5E5BFCD20C0CCBAA5C6AE2E646F6378> C# 코딩연습 멀티쓰레드와이벤트 2009-05-18 김태현 (kimgwajang@hotmail.com) I. 서 제블로그 1 의카테고리중에.NET Tip of The Day' 라는것이있는데, 동명의사이트 2 에실린유용한닷넷팁들을번역하여소개하는포스팅이모여있습니다. 이중 Correct event invocation 3 라는제목의포스트가있는데, 멀티쓰레드환경에서이벤트를호출하는올바른방법에관해서설명을하고있습니다.

More information

유니티 변수-함수.key

유니티 변수-함수.key C# 1 or 16 (Binary or Hex) 1:1 C# C# (Java, Python, Go ) (0101010 ). (Variable) : (Value) (Variable) : (Value) ( ) (Variable) : (Value) ( ) ; (Variable) : (Value) ( ) ; = ; (Variable) : (Value) (Variable)

More information

untitled

untitled - -, (insert) (delete) - - (insert) (delete) (top ) - - (insert) (rear) (delete) (front) A A B top A B C top push(a) push(b) push(c) A B top pop() top A B D push(d) top #define MAX_STACK_SIZE 100 int

More information

chap 5: Trees

chap 5: Trees 5. Threaded Binary Tree 기본개념 n 개의노드를갖는이진트리에는 2n 개의링크가존재 2n 개의링크중에 n + 1 개의링크값은 null Null 링크를다른노드에대한포인터로대체 Threads Thread 의이용 ptr left_child = NULL 일경우, ptr left_child 를 ptr 의 inorder predecessor 를가리키도록변경

More information

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi

[ 마이크로프로세서 1] 2 주차 3 차시. 포인터와구조체 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Functi 2 주차 3 차시포인터와구조체 학습목표 1. C 언어에서가장어려운포인터와구조체를설명할수있다. 2. Call By Value 와 Call By Reference 를구분할수있다. 학습내용 1 : 함수 (Function) 1. 함수의개념 입력에대해적절한출력을발생시켜주는것 내가 ( 프로그래머 ) 작성한명령문을연산, 처리, 실행해주는부분 ( 모듈 ) 자체적으로실행되지않으며,

More information

슬라이드 1

슬라이드 1 Pairwise Tool & Pairwise Test NuSRS 200511305 김성규 200511306 김성훈 200614164 김효석 200611124 유성배 200518036 곡진화 2 PICT Pairwise Tool - PICT Microsoft 의 Command-line 기반의 Free Software www.pairwise.org 에서다운로드후설치

More information

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 제 5 장생성자와접근제어 1. 객체지향기법을이해한다. 2. 클래스를작성할수있다. 3. 클래스에서객체를생성할수있다. 4. 생성자를이용하여객체를초기화할수 있다. 5. 접근자와설정자를사용할수있다. 이번장에서만들어볼프로그램 생성자 생성자 (constructor) 는초기화를담당하는함수 생성자가필요한이유 #include using namespace

More information

PowerPoint Presentation

PowerPoint Presentation Package Class 1 Heeseung Jo 목차 section 1 패키지개요와패키지의사용 section 2 java.lang 패키지의개요 section 3 Object 클래스 section 4 포장 (Wrapper) 클래스 section 5 문자열의개요 section 6 String 클래스 section 7 StringBuffer 클래스 section

More information

Microsoft PowerPoint - 07-C#-2-기초문법.ppt [호환 모드]

Microsoft PowerPoint - 07-C#-2-기초문법.ppt [호환 모드] 기본자료형 연산자와제어문 배열 컬렉션과반복자 순천향대학교컴퓨터학부이상정 1 기본자료형 순천향대학교컴퓨터학부이상정 2 C# 자료형 C# 은.NET 프레임워크가제공하는 CTS(Common Type System) 자료형을사용 CTS는닷넷기반의여러언어에서공통으로사용되는자료형 CTS 는값 (value) 형과참조형 (reference) 형지원 CTS가제공하는모든데이터형은

More information

- JPA를사용하는경우의스프링설정파일에다음을기술한다. <bean id="entitymanagerfactory" class="org.springframework.orm.jpa.localentitymanagerfactorybean" p:persistenceunitname=

- JPA를사용하는경우의스프링설정파일에다음을기술한다. <bean id=entitymanagerfactory class=org.springframework.orm.jpa.localentitymanagerfactorybean p:persistenceunitname= JPA 와 Hibernate - 스프링의 JDBC 대신에 JPA를이용한 DB 데이터검색작업 - JPA(Java Persistence API) 는자바의 O/R 매핑에대한표준지침이며, 이지침에따라설계된소프트웨어를 O/R 매핑프레임워크 라고한다. - O/R 매핑 : 객체지향개념인자바와관계개념인 DB 테이블간에상호대응을시켜준다. 즉, 객체지향언어의인스턴스와관계데이터베이스의레코드를상호대응시킨다.

More information

DocsPin_Korean.pages

DocsPin_Korean.pages Unity Localize Script Service, Page 1 Unity Localize Script Service Introduction Application Game. Unity. Google Drive Unity.. Application Game. -? ( ) -? -?.. 준비사항 Google Drive. Google Drive.,.. - Google

More information

rmi_박준용_final.PDF

rmi_박준용_final.PDF (RMI) - JSTORM http://wwwjstormpekr (RMI)- Document title: Document file name: Revision number: Issued by: Document Information (RMI)- rmi finaldoc Issue Date: Status:

More information

hlogin7

hlogin7 0x07. Return Oriented Programming ROP? , (DEP, ASLR). ROP (Return Oriented Programming) (excutable memory) rop. plt, got got overwrite RTL RTL Chain DEP, ASLR gadget Basic knowledge plt, got call function

More information

Microsoft PowerPoint - 2강

Microsoft PowerPoint - 2강 컴퓨터과학과 김희천교수 학습개요 Java 언어문법의기본사항, 자료형, 변수와상수선언및사용법, 각종연산자사용법, if/switch 등과같은제어문사용법등에대해설명한다. 또한 C++ 언어와선언 / 사용방법이다른 Java의배열선언및사용법에대해서설명한다. Java 언어의효과적인활용을위해서는기본문법을이해하는것이중요하다. 객체지향의기본개념에대해알아보고 Java에서어떻게객체지향적요소를적용하고있는지살펴본다.

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 클래스와메소드심층연구 ( 실습 ) 손시운 ssw5176@kangwon.ac.kr 예제 1. 접근제어 class A { private int a; int b; public int c; // 전용 // 디폴트 // 공용 public class Test { public static void main(string args[]) { A obj = new

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 @ Lesson 1,..... @ 1 Green Project 1991 Oak Java 1995. 5 December '90 by Patrick Naughton, Mike Sheridan and James Gosling Embedded in various consumer electronic device 1992. 9. 3 Star 7 1993 www portability

More information

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과

임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 임베디드시스템설계강의자료 6 system call 2/2 (2014 년도 1 학기 ) 김영진 아주대학교전자공학과 System call table and linkage v Ref. http://www.ibm.com/developerworks/linux/library/l-system-calls/ - 2 - Young-Jin Kim SYSCALL_DEFINE 함수

More information

금오공대 컴퓨터공학전공 강의자료

금오공대 컴퓨터공학전공 강의자료 C 프로그래밍프로젝트 Chap 14. 포인터와함수에대한이해 2013.10.09. 오병우 컴퓨터공학과 14-1 함수의인자로배열전달 기본적인인자의전달방식 값의복사에의한전달 val 10 a 10 11 Department of Computer Engineering 2 14-1 함수의인자로배열전달 배열의함수인자전달방식 배열이름 ( 배열주소, 포인터 ) 에의한전달 #include

More information

1

1 1 1....6 1.1...6 2. Java Architecture...7 2.1 2SDK(Software Development Kit)...8 2.2 JRE(Java Runtime Environment)...9 2.3 (Java Virtual Machine, JVM)...10 2.4 JVM...11 2.5 (runtime)jvm...12 2.5.1 2.5.2

More information

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어 개나리 연구소 C 언어 노트 (tyback.egloos.com) 프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어먹고 하더라구요. 그래서,

More information

K&R2 Reference Manual 번역본

K&R2 Reference Manual 번역본 typewriter structunion struct union if-else if if else if if else if if if if else else ; auto register static extern typedef void char short int long float double signed unsigned const volatile { } struct

More information

Microsoft PowerPoint - Java7.pptx

Microsoft PowerPoint - Java7.pptx HPC & OT Lab. 1 HPC & OT Lab. 2 실습 7 주차 Jin-Ho, Jang M.S. Hanyang Univ. HPC&OT Lab. jinhoyo@nate.com HPC & OT Lab. 3 Component Structure 객체 (object) 생성개념을이해한다. 외부클래스에대한접근방법을이해한다. 접근제어자 (public & private)

More information

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600

Microsoft PowerPoint - ch10 - 이진트리, AVL 트리, 트리 응용 pm0600 균형이진탐색트리 -VL Tree delson, Velskii, Landis에의해 1962년에제안됨 VL trees are balanced n VL Tree is a binary search tree such that for every internal node v of T, the heights of the children of v can differ by at

More information

컴파일러

컴파일러 YACC 응용예 Desktop Calculator 7/23 Lex 입력 수식문법을위한 lex 입력 : calc.l %{ #include calc.tab.h" %} %% [0-9]+ return(number) [ \t] \n return(0) \+ return('+') \* return('*'). { printf("'%c': illegal character\n",

More information

PowerPoint Presentation

PowerPoint Presentation 객체지향프로그래밍 오류처리 손시운 ssw5176@kangwon.ac.kr 오류메시지를분석한다. 오류메시지에서많은내용을알수있다. 2 디버깅 디버거를사용하면프로그램에서쉽게오류를감지하고진단할수있다. 디버거는중단점을설정하여서프로그램의실행을제어할수있으며문장 단위로실행하거나변수의값을살펴볼수있다. 3 이클립스에서디버깅 4 이클립스에서디버깅 5 이클립스의디버깅명령어 6 예외처리

More information

쉽게

쉽게 Power Java 제 4 장자바프로그래밍기초 이번장에서학습할내용 자바프로그램에대한기초사항을학습 자세한내용들은추후에. Hello.java 프로그램 주석 주석 (comment): 프로그램에대한설명을적어넣은것 3 가지타입의주석 클래스 클래스 (class): 객체를만드는설계도 ( 추후에학습 ) 자바프로그램은클래스들로구성된다. 그림 4-1. 자바프로그램의구조 클래스정의

More information

C++ Programming

C++ Programming C++ Programming 연산자다중정의 Seo, Doo-okok clickseo@gmail.com http://www.clickseo.com 목 차 연산자다중정의 C++ 스타일의문자열 2 연산자다중정의 연산자다중정의 단항연산자다중정의 이항연산자다중정의 cin, cout 그리고 endl C++ 스타일의문자열 3 연산자다중정의 연산자다중정의 (Operator

More information

05-class.key

05-class.key 5 : 2 (method) (public) (private) (interface) 5.1 (Method), (public method) (private method) (constructor), 3 4 5.2 (client). (receiver)., System.out.println("Hello"); (client object) (receiver object)

More information

chap x: G입력

chap x: G입력 재귀알고리즘 (Recursive Algorithms) 재귀알고리즘의특징 문제자체가재귀적일경우적합 ( 예 : 피보나치수열 ) 이해하기가용이하나, 비효율적일수있음 재귀알고리즘을작성하는방법 재귀호출을종료하는경계조건을설정 각단계마다경계조건에접근하도록알고리즘의재귀호출 재귀알고리즘의두가지예 이진검색 순열 (Permutations) 1 장. 기본개념 (Page 19) 이진검색의재귀알고리즘

More information

(8) getpi() 함수는정적함수이므로 main() 에서호출할수있다. (9) class Circle private double radius; static final double PI= ; // PI 이름으로 로초기화된정적상수 public

(8) getpi() 함수는정적함수이므로 main() 에서호출할수있다. (9) class Circle private double radius; static final double PI= ; // PI 이름으로 로초기화된정적상수 public Chapter 9 Lab 문제정답 1. public class Circle private double radius; static final double PI=3.141592; // PI 이름으로 3.141592 로초기화된정적상수 (1) public Circle(double r) radius = r; (2) public double getradius() return

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 Lab 4 ADT Design 클래스로정의됨. 모든객체들은힙영역에할당됨. 캡슐화 (Encapsulation) : Data representation + Operation 정보은닉 (Information Hiding) : Opertion부분은가려져있고, 사용자가 operation으로만사용가능해야함. 클래스정의의형태 public class Person { private

More information

09-interface.key

09-interface.key 9 Database insert(record r): boolean find(key k): Record 1 Record getkey(): Key * Record Key Database.? Key equals(key y): boolean Database insert(record r): boolean find(key k): Record * Database OK 1

More information