gnu-lee-oop-kor-lec11-1-chap15

Size: px
Start display at page:

Download "gnu-lee-oop-kor-lec11-1-chap15"

Transcription

1 어서와 Java 는처음이지! 제 15 장컬렉션

2 컬렉션 (collection) 은자바에서자료구조를구현한클래스 자료구조로는리스트 (list), 스택 (stack), 큐 (queue), 집합 (set), 해쉬테이블 (hash table) 등이있다.

3 자바는컬렉션인터페이스와컬렉션클래스로나누어서제공한다. 자바에서는컬렉션인터페이스를구현한클래스도함께제공하므로이것을간단하게사용할수도있고아니면각자필요에맞추어인터페이스를자신의클래스로구현할수도있다.

4

5

6 집합 (Set) 은원소의중복을허용하지않는다.

7 HashSet HashSet 은해쉬테이블에원소를저장하기때문에성능면에서가장우수하다. 하지만원소들의순서가일정하지않은단점이있다. TreeSet 레드 - 블랙트리 (red-black tree) 에원소를저장한다. 따라서값에따라서순서가결정되며하지만 HashSet 보다는느리다. LinkedHashSet 해쉬테이블과연결리스트를결합한것으로원소들의순서는삽입되었던순서와같다.

8 import java.util.*; public class SetTest { x public static void main(string args[]) { HashSet<String> set = new HashSet<String>(); set.add("milk"); set.add("bread"); set.add("butter"); set.add("cheese"); set.add("ham"); set.add("ham"); System.out.println(set); [Bread, Milk, Butter, Ham, Cheese]

9 import java.util.*; public class FindDupplication { public static void main(string[] args) { Set<String> s = new HashSet<String>(); String[] sample = { " 단어 ", " 중복 ", " 구절 ", " 중복 " ; for (String a : sample) if (!s.add(a)) System.out.println(" 중복된단어 " + a); System.out.println(s.size() + " 중복되지않은단어 : " + s); 중복된단어중복 3 중복되지않은단어 : [ 중복, 구절, 단어 ]

10 s1.containsall(s2) 만약 s2 가 s1 의부분집합이면참이다. s1.addall(s2) s1 을 s1 과 s2 의합집합으로만든다. s1.retainall(s2) s1 을 s1 과 s2 의교집합으로만든다. s1.removeall(s2) s1 을 s1 과 s2 의차집합으로만든다.

11 public class SetTest1 { public static void main(string[] args) { 합집합 [D, A, B, C] 교집합 [A] Set<String> s1 = new HashSet<String>(); Set<String> s2 = new HashSet<String>(); s1.add("a"); s1.add("b"); s1.add("c"); s2.add("a"); s2.add("d"); Set<String> union = new HashSet<String>(s1); union.addall(s2); Set<String> intersection = new HashSet<String>(s1); intersection.retainall(s2); System.out.println(" 합집합 " + union); System.out.println(" 교집합 " + intersection);

12 리스트 (List) 는순서를가지는요소들의모임으로중복된요소를가질수있다.

13 ArrayList 를배열 (Array) 의향상된버전또는가변크기의배열이라고생각하면된다. ArrayList 의생성 ArrayList<String> list = new ArrayList<String>(); 원소추가 list.add( "MILK" ); list.add( "BREAD" ); list.add( "BUTTER" );

14 ArrayList<String> list = new ArrayList<String>(); list.add( "MILK" ); list.add( "BREAD" ); list.add( "BUTTER" ); list.add( 1, "APPLE" ); // 인덱스 1 에 "APPLE" 을삽입 list.set( 2, "GRAPE" ); // 인덱스 2 의원소를 "GRAPE" 로대체 list.remove( 3 ); // 인덱스 3 의원소를삭제한다.

15 빈번하게삽입과삭제가일어나는경우에사용

16 import java.util.*; public class LinkedListTest { public static void main(string args[]) { LinkedList<String> list = new LinkedList<String>(); list.add("milk"); list.add("bread"); list.add("butter"); list.add(1, "APPLE"); list.set(2, "GRAPE"); // 인덱스 1에 APPLE" 을삽입 // 인덱스 2의원소를 GRAPE" 로대체 list.remove(3); // 인덱스 3 의원소를삭제한다. for (int i = 0; i < list.size(); i++) System.out.println(list.get(i));

17 ArrayList<String> list = new ArrayList<String>(); list.add(" 하나 ); list.add(" 둘 ); list.add(" 셋 ); list.add(" 넷 ); String s; Iterator e = list.iterator(); while(e.hasnext()) { s = (String)e.next(); // 반복자는 Object 타입을반환! System.out.println(s); MILK APPLE GRAPE

18 List<String> list = Arrays.asList(new String[size]); 일반적인배열을리스트로변환한다.

19 큐는후단 (tail) 에서원소를추가하고전단 (head) 에서원소를삭제한다.

20 import java.util.*; public class QueueTest { public static void main(string[] args) throws InterruptedException { int time = 10; Queue<Integer> queue = new LinkedList<Integer>(); for (int i = time; i >= 0; i--) queue.add(i); while (!queue.isempty()) { System.out.print(queue.remove()+" "); Thread.sleep(1000); // 현재의스레드를 1 초간재운다

21 우선순위큐는원소들이무작위로삽입되었더라도정렬된상태로원소들을추출한다. 즉 remove() 를호출할때마다가장작은원소가추출된다. 우선순위큐는히프 (heap) 라고하는자료구조를내부적으로사용한다.

22 import java.util.*; public class PriorityQueueTest { public static void main(string[] args) { PriorityQueue<Integer> pq = new PriorityQueue<Integer>(); pq.add(30); pq.add(80); pq.add(20); for (Integer o : pq) System.out.println(o); System.out.println(" 원소삭제 "); while (!pq.isempty()) System.out.println(pq.remove()); 원소삭제

23 Map 은많은데이터중에서원하는데이터를빠르게찾을수있는자료구조이다. 맵은사전과같은자료구조이다.

24 import java.util.*; class Student { int number; String name; public Student(int number, String name) { this.number = number; this.name = name; public String tostring() { return name;

25 public class MapTest { public static void main(string[] args) { Map<String, Student> st = new HashMap<String, Student>(); st.put(" ", new Student( , " 구준표 ")); st.put(" ", new Student( , " 금잔디 ")); st.put(" ", new Student( , " 윤지후 ")); // 모든항목을출력한다. System.out.println(st); // 하나의항목을삭제한다. st.remove(" "); // 하나의항목을대치한다. st.put(" ", new Student( , " 소이정 ")); // 값을참조한다. System.out.println(st.get(" ")); // 모든항목을방문한다. for (Map.Entry<String, Student> s : st.entryset()) { String key = s.getkey(); Student value = s.getvalue(); System.out.println("key=" + key + ", value=" + value);

26 { = 구준표, = 금잔디, = 윤지후 소이정 key= , value= 구준표 key= , value= 소이정

27 Collections 클래스는여러유용한알고리즘을구현한메소드들을제공한다. 정렬 (Sorting) 섞기 (Shuffling) 탐색 (Searching)

28 정렬은데이터를어떤기준에의하여순서대로나열하는것이다.

29 import java.util.*; public class Sort { public static void main(string[] args) { String[] sample = { "i", "walk", "the", "line" ; List<String> list = Arrays.asList(sample); Collections.sort(list); System.out.println(list); // 배열을리스트로변경 [i, line, the, walk]

30 탐색이란리스트안에서원하는원소를찾는것이다.

31 import java.util.*; public class Search { public static void main(string[] args) { int key = 50; List<Integer> list = new ArrayList<Integer>(); for (int i = 0; i < 100; i++) list.add(i); int index = Collections.binarySearch(list,key); System.out.println(" 탐색의반환값 =" + index); 탐색의반환값 =50

32 여기서는 Map 을사용하여서영어사전을구현하여보자. 사용자가단어를입력하면단어의설명을보여준다. 영어단어를입력하시오 :map 단어의의미는지도영어단어를입력하시오 :school 단어의의미는학교영어단어를입력하시오 :quit

33 import java.util.*; public class EnglishDic { public static void main(string[] args) { Map<String, String> st = new HashMap<String, String>(); st.put("map", " 지도 "); st.put("java", " 자바 "); st.put("school", " 학교 "); Scanner sc = new Scanner(System.in); do { System.out.print(" 영어단어를입력하시오 :"); String key = sc.next(); if( key.equals("quit") ) break; System.out.println(" 단어의의미는 " + st.get(key)); while(true);

쉽게 풀어쓴 C 프로그래밍

쉽게 풀어쓴 C 프로그래밍 Power Java 제 22 장제네릭과컬렉션 이번장에서학습할내용 제네릭클래스 제네릭메소드 컬렉션 ArrayList LinkedList Set Queue Map Collections 클래스 일반적인하나의코드로다양한자료형을처리하는기법을살펴봅시다. 제네릭이란? 제네릭프로그래밍 (generic programming) 다양한타입의객체를동일한코드로처리하는기법 제네릭은컬렉션라이브러리에많이사용

More information

Microsoft PowerPoint - Lect07.pptx

Microsoft PowerPoint - Lect07.pptx 이강의록은 Power Java 저자의강의록을사용했거나재편집된것입니다. Package 개념 Package 묶는방법사용하기기본 Package Utility Package Generic Class Generic Method Collection ArrayList LinkedList Set Queue Map Collection Class 3 패키지 (package)

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

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

PowerPoint Presentation

PowerPoint Presentation Package Class 3 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

PowerPoint Presentation

PowerPoint Presentation 자바프로그래밍 1 배열 손시운 ssw5176@kangwon.ac.kr 배열이필요한이유 예를들어서학생이 10 명이있고성적의평균을계산한다고가정하자. 학생 이 10 명이므로 10 개의변수가필요하다. int s0, s1, s2, s3, s4, s5, s6, s7, s8, s9; 하지만만약학생이 100 명이라면어떻게해야하는가? int s0, s1, s2, s3, s4,

More information

JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 ( ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각

JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 (   ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각 JAVA 프로그래밍실습 실습 1) 실습목표 - 메소드개념이해하기 - 매개변수이해하기 - 새메소드만들기 - Math 클래스의기존메소드이용하기 ( http://java.sun.com/javase/6/docs/api ) 문제 - 직사각형모양의땅이있다. 이땅의둘레, 면적과대각선의길이를계산하는메소드들을작성하라. 직사각형의가로와세로의길이는주어진다. 대각선의길이는 Math클래스의적절한메소드를이용하여구하라.

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

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

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

PowerPoint 프레젠테이션

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

More information

슬라이드 1

슬라이드 1 컬렉션프레임워크 (Collection Framework) 의정의 - 다수의데이터를쉽게처리할수있는표준화된방법을제공하는클래스들 - 데이터의집합을다루고표현하기위한단일화된구조 (architecture) - JDK 1.2 이전까지는 Vector, Hashtable, Properties와같은컬렉션클래스로서로다른각자의방식으로처리 - 컬렉션프레임워크는다수의데이터를다루는데필요한다양하고풍부한클래스들을제공하므로프로그래머의부담을상당부분덜어준다.

More information

선형대수학 Linear Algebra

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

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

PowerPoint Presentation

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

More information

<4D F736F F F696E74202D20C1A63038C0E520C5ACB7A1BDBABFCD20B0B4C3BC4928B0ADC0C729205BC8A3C8AF20B8F0B5E55D>

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

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 제네릭 배효철 th1g@nate.com 1 목차 제네릭 컬렉션 백터 ArrayList HashMap LinkedList Collections 클래스 제네릭만들기 컬렉션과자동박싱 / 언박싱 제네릭의장점 2 제네릭 특정타입만다루지않고, 여러종류의타입으로변신할수있도록클래스나메소드를일반화시키는기법 , , : 타입매개변수 요소타입을일반화한타입 제네릭클래스사례

More information

항상쌍 ( 키, 값 ) 으로만데이터를저장하는클래스 의최고조상 : Map - Map을조상으로하는클래스, HashTable, HashMap, LinkedHashMap, TreeMap 등은데이터를저장할때반드시 키 와 값 의쌍으로저장한다. - Map에저장되는 키 는중복되면안되

항상쌍 ( 키, 값 ) 으로만데이터를저장하는클래스 의최고조상 : Map - Map을조상으로하는클래스, HashTable, HashMap, LinkedHashMap, TreeMap 등은데이터를저장할때반드시 키 와 값 의쌍으로저장한다. - Map에저장되는 키 는중복되면안되 무엇이든다받아주는클래스 2 컬렉션프레임워크에저장된데이터를순차적으로처리하는방법 : Iterator 객체사용 - get() 메서드를사용하면 Iterator 를사용하지않아도원하는위치의데이터를찾을수있다. - get() 메서드는원하는데이터를찾는작업을항상처음데이터부터시작한다. - Iterator 는주소를사용해서현재탐색한위치부터새로운탐색을시작하므로, 위의 get() 메서드보다훨씬처리시

More information

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공

목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper 클래스작성 - JSONParser 클래스작성 공공 메신저의새로운혁신 채팅로봇 챗봇 (Chatbot) 입문하기 소 이 메 속 : 시엠아이코리아 름 : 임채문 일 : soulgx@naver.com 1 목차 INDEX JSON? - JSON 개요 - JSONObject - JSONArray 서울시공공데이터 API 살펴보기 - 요청인자살펴보기 - Result Code - 출력값 HttpClient - HttpHelper

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

교육자료

교육자료 THE SYS4U DODUMENT Java Reflection & Introspection 2012.08.21 김진아사원 2012 SYS4U I&C All rights reserved. 목차 I. 개념 1. Reflection 이란? 2. Introspection 이란? 3. Reflection 과 Introspection 의차이점 II. 실제사용예 1. Instance의생성

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

PowerPoint Presentation

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

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

JAVA PROGRAMMING 실습 09. 예외처리

JAVA PROGRAMMING 실습 09. 예외처리 2015 학년도 2 학기 예외? 프로그램실행중에발생하는예기치않은사건 예외가발생하는경우 정수를 0으로나누는경우 배열의크기보다큰인덱스로배열의원소를접근하는경우 파일의마지막부분에서데이터를읽으려고하는경우 예외처리 프로그램에문제를발생시키지않고프로그램을실행할수있게적절한조치를취하는것 자바는예외처리기를이용하여예외처리를할수있는기법제공 자바는예외를객체로취급!! 나뉨수를입력하시오

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

Java

Java Java http://cafedaumnet/pway Chapter 1 1 public static String format4(int targetnum){ String strnum = new String(IntegertoString(targetNum)); StringBuffer resultstr = new StringBuffer(); for(int i = strnumlength();

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

슬라이드 1

슬라이드 1 CHAP 6: 큐 yicho@gachon.ac.kr 1 큐 (QUEUE) 큐 : 먼저들어온데이터가먼저나가는자료구조 선입선출 (FIFO: First-In First-Out) ( 예 ) 매표소의대기열 Ticket Box 전단 () 후단 () 2 큐 ADT 삽입과삭제는 FIFO 순서를따른다. 삽입은큐의후단에서, 삭제는전단에서이루어진다. 객체 : n 개의 element

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

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 명품 JAVA Essential 1 2 학습목표 1. 컬렉션과제네릭개념 2. Vector 활용 3. ArrayList 활용 4. HashMap 활용 5. Iterator 활용 6. 사용자제네릭클래스만들기 컬렉션 (collection) 의개념 3 컬렉션 요소 (element) 라고불리는가변개수의객체들의저장소 객체들의컨테이너라고도불림 요소의개수에따라크기자동조절

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 Presentation

PowerPoint Presentation 객체지향프로그래밍 클래스, 객체, 메소드 손시운 ssw5176@kangwon.ac.kr 실제세계는객체로이루어진다. 2 객체와메시지 3 객체지향이란? 실제세계를모델링하여소프트웨어를개발하는방법 4 객체 5 객체란? 객체 (Object) 는상태와동작을가지고있다. 객체의상태 (state) 는객체의특징값 ( 속성 ) 이다. 객체의동작 (behavior) 또는행동은객체가취할수있는동작

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

90 Java의정석定石 3판 - 연습문제풀이 Chapter 컬렉션프레임웍 Collections Framework

90 Java의정석定石 3판 - 연습문제풀이 Chapter 컬렉션프레임웍 Collections Framework 90 Chapter 컬렉션프레임웍 Collections Framework 91 [ 연습문제 ] [11-1] 다음은정수집합 1,2,3,4와 3,4,5,6 의교집합, 차집합, 합집합을구하는코드이 다. 코드를완성하여실행결과와같은결과를출력하시오. [Hint] ArrayList클래스의 addall(), removeall(), retainall() 을사용하라. [ 연습문제]/ch11/Exercise11_1.java

More information

Microsoft PowerPoint 자바-기본문법(Ch2).pptx

Microsoft PowerPoint 자바-기본문법(Ch2).pptx 자바기본문법 1. 기본사항 2. 자료형 3. 변수와상수 4. 연산자 1 주석 (Comments) 이해를돕기위한설명문 종류 // /* */ /** */ 활용예 javadoc HelloApplication.java 2 주석 (Comments) /* File name: HelloApplication.java Created by: Jung Created on: March

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

03_queue

03_queue Queue Data Structures and Algorithms 목차 큐의이해와 ADT 정의 큐의배열기반구현 큐의연결리스트기반구현 큐의활용 덱 (Deque) 의이해와구현 Data Structures and Algorithms 2 큐의이해와 ADT 정의 Data Structures and Algorithms 3 큐 (Stack) 의이해와 ADT 정의 큐는 LIFO(Last-in,

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

쉽게 풀어쓴 C 프로그래밍

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

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

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

쉽게 풀어쓴 C 프로그래밊

쉽게 풀어쓴 C 프로그래밊 Power Java 제 27 장데이터베이스 프로그래밍 이번장에서학습할내용 자바와데이터베이스 데이터베이스의기초 SQL JDBC 를이용한프로그래밍 변경가능한결과집합 자바를통하여데이터베이스를사용하는방법을학습합니다. 자바와데이터베이스 JDBC(Java Database Connectivity) 는자바 API 의하나로서데이터베이스에연결하여서데이터베이스안의데이터에대하여검색하고데이터를변경할수있게한다.

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

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

Java ...

Java ... 컴퓨터언어 1 Java 제어문 조성일 조건문 : if, switch 어떠한조건을조사하여각기다른명령을실행 if 문, switch 문 if 문 if - else 문형식 if 문형식 if ( 조건식 ) { 명령문 1; 명령문 2;... if ( 조건식 ) { 명령문 1; 명령문 2;... else { 명령문 a; 명령문 b;... 예제 1 정수를입력받아짝수와홀수를판별하는프로그램을작성하시오.

More information

자바-11장N'1-502

자바-11장N'1-502 C h a p t e r 11 java.net.,,., (TCP/IP) (UDP/IP).,. 1 ISO OSI 7 1977 (ISO, International Standards Organization) (OSI, Open Systems Interconnection). 6 1983 X.200. OSI 7 [ 11-1] 7. 1 (Physical Layer),

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 프레젠테이션 예외처리 배효철 th1g@nate.com 1 목차 예외와예외클래스 실행예외 예외처리코드 예외종류에따른처리코드 자동리소스닫기 예외처리떠넘기기 사용자정의예외와예외발생 예외와예외클래스 구문오류 예외와예외클래스 구문오류가없는데실행시오류가발생하는경우 예외와예외클래스 import java.util.scanner; public class ExceptionExample1

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

Chapter 4. LISTS

Chapter 4. LISTS 6. 동치관계 (Equivalence Relations) 동치관계 reflexive, symmetric, transitive 성질을만족 "equal to"(=) 관계는동치관계임. x = x x = y 이면 y = x x = y 이고 y = z 이면 x = z 동치관계를이용하여집합 S 를 동치클래스 로분할 동일한클래스내의원소 x, y 에대해서는 x y 관계성립

More information

Microsoft Word - java18-1-final-answer.doc

Microsoft Word - java18-1-final-answer.doc 기말고사 담당교수 : 단국대학교응용컴퓨터공학박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 답안지에학과, 학번, 이름외에본인의암호 (4자리숫자 ) 를기입하면성적공고시학번대신암호를사용할것임. 1. 다음 sub1 과 sub2

More information

슬라이드 1

슬라이드 1 CHP 6: 큐 C 로쉽게풀어쓴자료구조 생능출판사 2005 큐 (QUEUE) 큐 : 먼저들어온데이터가먼저나가는자료구조 선입선출 (FIFO: First-In First-Out) ( 예 ) 매표소의대기열 Ticket Box 전단 () 후단 () 큐 DT 삽입과삭제는 FIFO 순서를따른다. 삽입은큐의후단에서, 삭제는전단에서이루어진다. 객체 : n 개의 element

More information

Microsoft PowerPoint - 08-chap06-Queue.ppt

Microsoft PowerPoint - 08-chap06-Queue.ppt / 큐 (QUEUE) Chapter 큐 : 먼저들어온데이터가먼저나가는자료구조 선입선출 (FIFO: First-In First-Out) ( 예 ) 매표소의대기열 큐 Ticket ox Dongwon Jeong djeong@kunsan.ac.kr Department of Kunsan National University 전단 () 후단 () 학습목표 큐 DT 큐의개념및추상데이터타입에대한이해

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

쉽게 풀어쓴 C 프로그래밍

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

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

Spring Boot/JDBC JdbcTemplate/CRUD 예제

Spring Boot/JDBC JdbcTemplate/CRUD 예제 Spring Boot/JDBC JdbcTemplate/CRUD 예제 오라클자바커뮤니티 (ojc.asia, ojcedu.com) Spring Boot, Gradle 과오픈소스인 MariaDB 를이용해서 EMP 테이블을만들고 JdbcTemplate, SimpleJdbcTemplate 을이용하여 CRUD 기능을구현해보자. 마리아 DB 설치는다음 URL 에서확인하자.

More information

2002년 2학기 자료구조

2002년 2학기 자료구조 자료구조 (Data Structures) Chapter 1 Basic Concepts Overview : Data (1) Data vs Information (2) Data Linear list( 선형리스트 ) - Sequential list : - Linked list : Nonlinear list( 비선형리스트 ) - Tree : - Graph : (3)

More information

java.lang 패키지 java.util 패키지 java.io 패키지 콜렉션 2

java.lang 패키지 java.util 패키지 java.io 패키지 콜렉션 2 java.lang 패키지 java.util 패키지 java.io 패키지 콜렉션 kkman@sangji.ac.kr 2 서로연관된클래스나인터페이스를하나의단위로묶는방법 자주사용되는클래스나인터페이스를위해패키지를제공 기본패키지 java.lang, java.util, java.io, java.net, java.awt, java.applet,... 사용자정의패키지 패키지이름은소문자로...

More information

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures

A Hierarchical Approach to Interactive Motion Editing for Human-like Figures 단일연결리스트 (Singly Linked List) 신찬수 연결리스트 (linked list)? tail 서울부산수원용인 null item next 구조체복습 struct name_card { char name[20]; int date; } struct name_card a; // 구조체변수 a 선언 a.name 또는 a.date // 구조체 a의멤버접근 struct

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

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 - java1-lecture9.ppt [\310\243\310\257 \270\360\265\345])

(Microsoft PowerPoint - java1-lecture9.ppt [\310\243\310\257 \270\360\265\345]) 컬렉션 (collection) 의개념 Collections, Generic 514760-1 2016 년가을학기 11/24/2016 박경신 컬렉션 요소 (element) 라고불리는가변개수의객체들의저장소 객체들의컨테이너라고도불림 요소의개수에따라크기자동조절 요소의삽입, 삭제에따른요소의위치자동이동 고정크기의배열을다루는어려움해소 다양한객체들의삽입, 삭제, 검색등의관리용이

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

Spring Data JPA Many To Many 양방향 관계 예제

Spring Data JPA Many To Many 양방향 관계 예제 Spring Data JPA Many To Many 양방향관계예제 오라클자바커뮤니티 (ojc.asia, ojcedu.com) 엔티티매핑 (Entity Mapping) M : N 연관관계 사원 (Sawon), 취미 (Hobby) 는다 : 다관계이다. 사원은여러취미를가질수있고, 하나의취미역시여러사원에할당될수있기때문이다. 보통관계형 DB 에서는다 : 다관계는 1

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

JAVA PROGRAMMING 실습 02. 표준 입출력

JAVA PROGRAMMING 실습 02. 표준 입출력 # 메소드의구조자주반복하여사용하는내용에대해특정이름으로정의한묶음 반환형메소드이름 ( 매개변수 ) { 실행문장 1; : 실행문장 N; } 메소드의종류 Call By Name : 메서드의이름에의해호출되는메서드로특정매개변수없이실행 Call By Value : 메서드를이름으로호출할때특정매개변수를전달하여그값을기초로실행하는메서드 Call By Reference : 메서드호출시매개변수로사용되는값이특정위치를참조하는

More information

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 배효철 th1g@nate.com 1 목차 표준입출력 파일입출력 2 표준입출력 표준입력은키보드로입력하는것, 주로 Scanner 클래스를사용. 표준출력은화면에출력하는메소드를사용하는데대표적으로 System.out.printf( ) 를사용 3 표준입출력 표준출력 : System.out.printlf() 4 표준입출력 Example 01 public static void

More information

4장.문장

4장.문장 문장 1 배정문 혼합문 제어문 조건문반복문분기문 표준입출력 입출력 형식화된출력 [2/33] ANSI C 언어와유사 문장의종류 [3/33] 값을변수에저장하는데사용 형태 : < 변수 > = < 식 > ; remainder = dividend % divisor; i = j = k = 0; x *= y; 형변환 광역화 (widening) 형변환 : 컴파일러에의해자동적으로변환

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

Chap 6: Graphs

Chap 6: Graphs 그래프표현법 인접행렬 (Adjacency Matrix) 인접리스트 (Adjacency List) 인접다중리스트 (Adjacency Multilist) 6 장. 그래프 (Page ) 인접행렬 (Adjacency Matrix) n 개의 vertex 를갖는그래프 G 의인접행렬의구성 A[n][n] (u, v) E(G) 이면, A[u][v] = Otherwise, A[u][v]

More information

12-file.key

12-file.key 11 (String).. java.lang.stringbuffer. s String s = "abcd"; s = s + "e"; a b c d e a b c d e ,., "910359,, " "910359" " " " " (token) (token),, (delimiter). java.util.stringtokenizer String s = "910359,,

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

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

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

More information

Microsoft PowerPoint - 08-Queue.ppt

Microsoft PowerPoint - 08-Queue.ppt Chapter Queue ( 큐 ) Dongwon Jeong djeong@kunsan.ac.kr Department of Informatics & Statistics 학습목표 큐의개념및추상데이터타입에대한이해 큐의구현방법 배열 링크드리스트 덱 / 데크의개념과구현방법 큐 (QUEUE) 큐 : 먼저들어온데이터가먼저나가는자료구조 선입선출 (FIFO: First-In

More information

06장.리스트

06장.리스트 ---------------- DATA STRUCTURES USING C ---------------- CHAPTER 리스트 1/28 리스트란? 리스트 (list), 선형리스트 (linear list) 순서를가진항목들의모임 집합 : 항목간의순서의개념이없음 리스트의예 요일 : ( 일요일, 월요일,, 토요일 ) 한글자음의모임 : ( ㄱ, ㄴ,, ㅎ ) 카드 :

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 Word - java19-1-midterm-answer.doc

Microsoft Word - java19-1-midterm-answer.doc 중간고사 담당교수 : 단국대학교응용컴퓨터공학박경신 답은반드시답안지에기술할것. 공간이부족할경우반드시답안지몇쪽의뒤에있다고명기한후기술할것. 그외의경우의답안지뒤쪽이나연습지에기술한내용은답안으로인정안함. 답에는반드시네모를쳐서확실히표시할것. 답안지에학과, 학번, 이름외에본인의암호 (4자리숫자 ) 를기입하면성적공고시학번대신암호를 사용할것임. 1. 다음질문에답을하라. (55

More information

class Sale void makelineitem(productspecification* spec, int qty) SalesLineItem* sl = new SalesLineItem(spec, qty); ; 2. 아래의액티비티다이어그램을보고 Java 또는 C ++,

class Sale void makelineitem(productspecification* spec, int qty) SalesLineItem* sl = new SalesLineItem(spec, qty); ; 2. 아래의액티비티다이어그램을보고 Java 또는 C ++, Level 1은객관식사지선다형으로출제예정 1. 다음은 POST(Post of Sales Terminal) 시스템의한콜레보레이션다이어그램이다. POST 객체의 enteritem(upc, qty) 와 Sale 객체의 makellineitem(spec,qty) 를 Java 또는 C ++, C # 언어로구현하시오. 각메소드구현과관련하여각객체내에필요한선언이있으면선언하시오.

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 - Lect04.pptx

Microsoft PowerPoint - Lect04.pptx OBJECT ORIENTED PROGRAMMING Object Oriented Programming 이강의록은 Power Java 저자의강의록을사용했거나재편집된것입니다. Class 와 object Class 와객체 클래스의일생 메소드 필드 String Object Class 와객체 3 클래스 클래스의구성 클래스 (l (class): 객체를만드는설계도 클래스로부터만들어지는각각의객체를특별히그클래스의인스턴스

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

슬라이드 1

슬라이드 1 UNIT 6 배열 로봇 SW 교육원 3 기 학습목표 2 배열을사용핛수있다. 배열 3 배열 (Array) 이란? 같은타입 ( 자료형 ) 의여러변수를하나의묶음으로다루는것을배열이라고함 같은타입의많은양의데이터를다룰때효과적임 // 학생 30 명의점수를저장하기위해.. int student_score1; int student_score2; int student_score3;...

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

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션 자료구조자바세미나 Week1 00 Contents 목차 01 Introduction 02 JAVA? 03 Basic Grammar 04 Array 05 String 06 Class & Method 07 Practice 01 Introduction 자료구조자바세미나기본소개 일시장소 IDE 대상 매주수요일저녁 6 시 (2019.03.20 ~ 2019.04.10)

More information

스레드의우선순위 우선순위설정메소드 : void setpriority(int newpriority) newpriority 에설정할수있는등급 : 1( 가장낮은우선순위 ) 부터 10( 가장높은우선순위 ) 가장높은우선순위 : MAX_PRIORITY, 보통우선순위 : NORM_

스레드의우선순위 우선순위설정메소드 : void setpriority(int newpriority) newpriority 에설정할수있는등급 : 1( 가장낮은우선순위 ) 부터 10( 가장높은우선순위 ) 가장높은우선순위 : MAX_PRIORITY, 보통우선순위 : NORM_ 10 초동안사용자가입력하지않으면종료하는예제 ) import javax.swing.joptionpane; class AutoTermination { static boolean inputcheck = false; public static void main(string[] args) throws Exception { FirstThread th1 = new FirstThread();

More information

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET 135-080 679-4 13 02-3430-1200 1 2 11 2 12 2 2 8 21 Connection 8 22 UniSQLConnection 8 23 8 24 / / 9 3 UniSQL 11 31 OID 11 311 11 312 14 313 16 314 17 32 SET 19 321 20 322 23 323 24 33 GLO 26 331 GLO 26

More information

쉽게

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

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

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드]

Microsoft PowerPoint - Supplement-03-TCP Programming.ppt [호환 모드] - Socket Programming in Java - 목차 소켓소개 자바에서의 TCP 프로그램작성방법 주요클래스와메소드 HTTP 프로토콜을이용한예제 에코프로그램 Q/A 에코프로그램 - EchoServer 에코프로그램 - EchoClient TCP Programming 1 소켓소개 IP, Port, and Socket 포트 (Port): 전송계층에서통신을수행하는응용프로그램을찾기위한주소

More information

파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter

파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter 파일로입출력하기II - 파일출력클래스중에는데이터를일정한형태로출력하는기능을가지고있다. - PrintWriter와 PrintStream을사용해서원하는형태로출력할수있다. - PrintStream은구버전으로가능하면 PrintWriter 클래스를사용한다. PrintWriter 클래스의사용법은다음과같다. PrintWriter writer = new PrintWriter("output.txt");

More information

Network Programming

Network Programming Part 5 확장된 Network Programming 기술 1. Remote Procedure Call 2. Remote Method Invocation 3. Object Request Broker 2. Java RMI

More information

Microsoft PowerPoint - 2강

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

More information

Microsoft PowerPoint - java1-lecture8.ppt [호환 모드]

Microsoft PowerPoint - java1-lecture8.ppt [호환 모드] 컬렉션 (collection) 의개념 Collections, Generic 514760-1 2018 년봄학기 5/1/2018 박경신 컬렉션 요소 (element) 라고불리는가변개수의객체들의저장소 객체들의컨테이너라고도불림 요소의개수에따라크기자동조절 요소의삽입, 삭제에따른요소의위치자동이동 고정크기의배열을다루는어려움해소 다양한객체들의삽입, 삭제, 검색등의관리용이

More information

Microsoft PowerPoint - java1-lecture8.ppt [호환 모드]

Microsoft PowerPoint - java1-lecture8.ppt [호환 모드] 컬렉션 (collection) 의개념 Collections, Generic 514760-1 2019 년봄학기 4/30/2019 박경신 컬렉션 요소 (element) 라고불리는가변개수의객체들의저장소 객체들의컨테이너라고도불림 요소의개수에따라크기자동조절 요소의삽입, 삭제에따른요소의위치자동이동 고정크기의배열을다루는어려움해소 다양한객체들의삽입, 삭제, 검색등의관리용이

More information

Microsoft PowerPoint - java1-lecture8.ppt [호환 모드]

Microsoft PowerPoint - java1-lecture8.ppt [호환 모드] 컬렉션 (collection) 의개념 Collections, Generic 514760-1 2017 년가을학기 11/6/2017 박경신 컬렉션 요소 (element) 라고불리는가변개수의객체들의저장소 객체들의컨테이너라고도불림 요소의개수에따라크기자동조절 요소의삽입, 삭제에따른요소의위치자동이동 고정크기의배열을다루는어려움해소 다양한객체들의삽입, 삭제, 검색등의관리용이

More information

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

신림프로그래머_클린코드.key CLEAN CODE 6 11st Front Dev. Team 6 1. 2. 3. checked exception 4. 5. 6. 11 : 2 4 : java (50%), javascript (35%), SQL/PL-SQL (15%) : Spring, ibatis, Oracle, jquery ? , (, ) ( ) 클린코드를 무시한다면 . 6 1. ,,,!

More information