Collection

    [자바/JAVA] 프로그래밍 - 컬렉션(Collection)_HashSet

    Student Class package com.kh.chap02_set.part01_hashSet.model.vo; public class Student { private String name; private int age; private int score; public Student() { } public Student(String name, int age, int score) { super(); this.name = name; this.age = age; this.score = score; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int getAge() {..

    [자바/JAVA] 프로그래밍 - 컬렉션(Collection) 실습 예제

    [문제 1] 다음과 같은 조건을 만족하는 프로그램을 작성 하시오 Dog Class package com.kh.practice.list.model.vo; public class Dog { private String name; private int age; private String kind; public Dog() { } public Dog(String name, int age, String kind) { super(); this.name = name; this.age = age; this.kind = kind; } public String getName() { return name; } public void setName(String name) { this.name = name; } public int ..

    [자바/JAVA] 프로그래밍 - 컬렉션(Collection)_ArrayList

    컬렉션이란? 자료구조 개념이 내장되어 있는 클래스로 자바에서 제공하는 "자료구조"를 담당하는 "프레임워크"이다. - 자료구조 : 방대한 데이터를 보다 효율적으로 관리(조회, 정렬, 추가, 수정, 삭제) 할 수 있도록 도와주는 개념 - 프레임워크 : 이미 만들어져있는 틀(뼈대) => 그냥 가져다 쓰면 됨 * 배열의 단점과 컬렉션의 장점 > 배열의 단점 1. 배열은 우선 크기를 지정해야됨!! 한번 지정된 크기를 변경할 수 없음!! 새로운 값을 더 추가하고자 한다면 새로운 크기의 배열을 만들고 기존꺼를 복사하는 코드를 직접 기술 2. 배열 중간 위치에 추가한다거나 삭제하는 경우 매번 값을 땡겨주는 복잡한 알고리즘을 직접 기술해야됨.. 3. 한 공간에 한 타입의 데이터만 저장 가능 > 컬렉션의 장점 1. 크기 ..