01-OOPConcepts(2).PDF

Similar documents
05-class.key

09-interface.key

02 C h a p t e r Java

자바GUI실전프로그래밍2_장대원.PDF

5장.key

rmi_박준용_final.PDF

초보자를 위한 자바 2 21일 완성 - 최신개정판

PowerPoint 프레젠테이션

Java ~ Java program: main() class class» public static void main(string args[])» First.java (main class ) /* The first simple program */ public class

자바 프로그래밍

1

비긴쿡-자바 00앞부속

chap10.PDF

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

PowerPoint 프레젠테이션

PowerPoint Presentation

쉽게 풀어쓴 C 프로그래밍

Microsoft PowerPoint - 04-UDP Programming.ppt

C# Programming Guide - Types

12-file.key

쉽게 풀어쓴 C 프로그래밍

MasoJava4_Dongbin.PDF

OOP 소개

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

Microsoft PowerPoint - java2 [호환 모드]

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

Chap12

JMF3_심빈구.PDF

Chap7.PDF

Orcad Capture 9.x

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

예제 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

제 1 강 희망의 땅, 알고리즘

자바-11장N'1-502

Something that can be seen, touched or otherwise sensed

Microsoft PowerPoint - chap11

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

10-Java Applet

03-JAVA Syntax(2).PDF

Microsoft PowerPoint - java1-lab5-ImageProcessorTestOOP.pptx

Week3

Design Issues

No Slide Title

JavaGeneralProgramming.PDF

ch09

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

C++-¿Ïº®Çؼ³10Àå

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

C++ Programming

int total = 0; for( int i=1; i<=5; i++ ) { for( int j=1; j<=i; i++ ) { total ++; System.out.println( total ); 대구분 : 객체와 Class 소구분 : 객체생성과사용 / Class 선언

Secure Programming Lecture1 : Introduction

JMF2_심빈구.PDF

UML

10장.key

Network Programming

Microsoft PowerPoint - 2강

; struct point p[10] = {{1, 2, {5, -3, {-3, 5, {-6, -2, {2, 2, {-3, -3, {-9, 2, {7, 8, {-6, 4, {8, -5; for (i = 0; i < 10; i++){ if (p[i].x > 0 && p[i

PowerPoint Presentation

쉽게 풀어쓴 C 프로그래밍

No Slide Title

제8장 자바 GUI 프로그래밍 II

Microsoft PowerPoint - 14주차 강의자료

Java

thesis

14-Servlet

JAVA PROGRAMMING 실습 08.다형성

04_오픈지엘API.key

Microsoft PowerPoint - 09-Object Oriented Programming-3.pptx

DocsPin_Korean.pages

PowerPoint 프레젠테이션

제목

신림프로그래머_클린코드.key

PowerPoint Template

03장

public key private key Encryption Algorithm Decryption Algorithm 1

歯처리.PDF

Eclipse 와 Firefox 를이용한 Javascript 개발 발표자 : 문경대 11 년 10 월 26 일수요일

어댑터뷰

Microsoft PowerPoint - ÀÚ¹Ù08Àå-1.ppt

9장.key

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

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

PowerPoint 프레젠테이션

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

Blog

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

<4D F736F F F696E74202D20C1A63233C0E520B1D7B7A1C7C820C7C1B7CEB1D7B7A1B9D628B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

PowerPoint Presentation

PowerPoint Presentation

<4D F736F F F696E74202D20C1A63038C0E520C5ACB7A1BDBABFCD20B0B4C3BC4928B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

chap8.PDF

2002년 2학기 자료구조

PowerPoint Presentation

제목

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

MAX+plus II Getting Started - 무작정따라하기

final_thesis

Microsoft PowerPoint - Java7.pptx

Mentor_PCB설계입문

Transcription:

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) int main( ) { f0( ); f1( ); f2( ); f3( ); f4( ); f5( ); f999( ); 3 + = + = f3( ); f5( ); f2( ); f4( ); f7( ); f1( ); f6( ); 4 2

#1,,,, point, line, polygon, rectangle, square, ellipse, circle, window, etc person, student, faculty, staff, part-timer, etc character, word, sentense, paragraph, documents, fonts, etc 5 #2 ( ) (State) (Behavior) (Identity) 6 3

! 7 Java class point { int xposition; int yposition; boolean status; colortype color; public: void move (int x, int y); void setcolor (colortype c); void penup ( ); void pendown ( ); 8 4

, (Blackbox) 9 Java class point { int xposition; int yposition; boolean status; colortype color; public: void move (int x, int y); void setcolor (colortype c); void penup ( ); void pendown ( ); move (int, int); setcolor (colortype ); penup ( ); pendown ( ); 10 5

,, Arguments <receiver> <operation_name> <arguments> mypoint move (10, 2); mypoint setcolor (blue); Receiver Arguments Sender 11 Bob, Person, (Specification) 12 6

Java [ ] class { public abstract final (abstract method) 13 class Employee { String name; String title; String dept; int salary; // public: void promote (String newtitle); void changedept(string newdept); void changesalary (int newsalary); // ; 14 7

(Instance) (Instance) class Employee { char* name; // ; Employee Kim; Employee Park; 15 (Object Reference); Employee Kim; Employee Park; Kim = new Employee(); Employee Kim = new Employee() & 16 8

Employee Kim = new Employee(); Employee Park = new Employee(); Kim Kimpromote( ); KimchangeDept( ); title ParkchangeSalary(3500); name dept Park name title dept salary 4500 salary 3000 17 (Garbage Collector) finalize() void finalize() { 18 9

Java (Attribute), class Point { // field int xposition; int yposition; // method void move(int x, int y); 19 ( ) private protected public package package 20 10

( ) private package protected public O O O O X X X X O X O O X O O O 21 (Superclass, Base class) (Subclass, Derived class, Extended class) (Class Inheritance Hierarchy) 22 11

class identifier extends Superclass { class ; Java Object 23 class Person { String name; String address: void changeaddress (String newaddress); void printlabel (int copies = 1); class Student extendsperson { deptcode major, minor; float GPA; int coursestaken; void printtranscript (int copies = 1); 24 12

,,( ) move(int x, int y); print( ); for Polygon and Circle for TextFile, GraphicFile and WordProcessorFile ( ) class printer { public: void print( ); void print(int n); // prints 1 copy // prints n copies 25 vs (Overriding) ( ) (Overroading) ( ) 26 13

: Print( ) Text files Word processor files Graphics files, print( ) Polymorphic print( ) Text File int print( ); File WP File int print( ); filename, filesize, virtual int print( ) = 0; Graphic File int print( ); 27 class DataRenderer { void draw(string s) { void draw(int i) { void draw(float f) { 28 14

(Abstract Class) (Property) ( ) abstractclass Number { (Concrete Class),, 29 Figure ClosedFigure Point OpenFigure Ellipse Polygon Arc Segment Circle Triangle Rectangle Line Square 30 15

colortype fillcolor; void setfillcolor(colortype c); virtual void fillfigure( ) = 0; float cx, xy; Ellipse ClosedFigure Polygon Figure Point int x, y; void move(int xx, int yy); Point* points; void move(int xx, int yy); float getperimeter( ); colortype color; int linewidth; void setcolor(colortype c): color(c) {; virtual void move(int xx, int yy) = 0; virtual float getperimeter( ) = 0; Arc OpenFigure Segment Circle void move(int xx, int yy); float getperimeter( ); Triangle Rectangle Square void move(int xx, int yy); float getperimeter( ); int length; void move(int xx, int yy); float getperimeter( ); Line 31 (1) + prototype interface { 32 16

(2) // Aquatic interface interface Aquatic { public void swim( ); public void breathunderwater( ); // Aquatic interface Mermaid class class Mermaid extends Human implements Aquatic { // public void swim( ) { // public void breathunderwater( ) { // 33 (1) ( ) package ; (import) import ; 34 17

(2) hyunhoontest PackageTest, 1 hyunhoon\test 2 hyunhoon\test PackageTestjava package hyunhoontest; class PackageTest { // 3 Compile \hyunhoon\test\javac PackageTestjava 4 \java hyunhoontestpackagetest 35 javalang javaio javautil javanet javaapplet AWT javaawt AWT javaawtimage AWT Peer javaawtpeer 36 18

,, (Object) (Class) (Inheritance) 37 19