분류 전체보기(57)
-
kh16일차(set,map,PointMgr7,StudentMgr5,Exception,io)
setTest package kh.java.func; import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.Scanner; public class SetTest { public void setTest() { HashSet set = new HashSet(); System.out.println("set 의 길이 : " + set.size()); set.add(10); System.out.println("set 의 길이 : " + set.size()); System.out.println(set); set.add(20); System.out.println("set 의 길이 : " + set..
2022.07.11 -
kh15일차 (Generics,List,studentMgr4,pointMgr5...)
Generics -func -Animal package kh.java.func; public class Animal { private int hp; public Animal() { super(); // TODO Auto-generated constructor stub } public Animal(int hp) { super(); this.hp = hp; } public int getHp() { return hp; } public void setHp(int hp) { this.hp = hp; } } AnimalMgr1 package kh.java.func; public class AnimalMgr1 { private Animal data; public AnimalMgr1() { super(); // TOD..
2022.07.08 -
kh14일차
objectApi kh.java.func StringClass package kh.java.func; import java.util.Random; import java.util.StringTokenizer; public class StringClass { public void test1() { //문자열 변경을 위한 StringBuffer사용 StringBuffer sb = new StringBuffer(); System.out.println("문자열 길이 : "+sb.length()); sb.append("hi");//현재 저장된 문자열에 매개변수로 전달한 문자를 추가 System.out.println(sb.toString()); sb.append(" 안녕"); System.out.println(sb...
2022.07.07 -
kh12일차
point 컨트롤러 package kr.or.iei.point.controller; import java.util.Scanner; import kr.or.iei.point.view.PointView; import kr.or.iei.point.vo.Grade; public class PointController { private Grade[] members; private int index; private Scanner sc; private PointView view; public PointController() { super(); members = new Grade[40]; sc = new Scanner(System.in); view = new PointView(); } public void main()..
2022.07.06 -
KH11일차
부모 package kh.java.func; public class Animal { public void breath() { System.out.println("헥헥"); } } 자식 package kh.java.func; public class Dog extends Animal{ public void hunting() { System.out.println("사냥"); } @Override public void breath() { System.out.println("낑낑"); } } 자식 package kh.java.func; public class Rabbit extends Animal{ public void jump() { System.out.println("깡총"); } } 테스트해본 코드들 Dog..
2022.07.04 -
KH10일차
상속을 배웠따. A부모클래스 package kh.java.func; //7.01 public class Aclass extends Object { private int num; private String str; public Aclass() { super(); System.out.println("A기본생성자"); // TODO Auto-generated constructor stub } public Aclass(int num, String str) { super(); System.out.println("A매개변수생성자"); this.num = num; this.str = str; } public int getNum() { return num; } public void setNum(int num) { th..
2022.07.01