분류 전체보기
-
Stack클래스?국비 교육 내용 정리 2023. 6. 17. 16:33
/* * Stack 클래스 : LIFO(Last in First out) * Vector 클래스의 하위 클래스임 * void push(Object) : 객체를 stack에 저장. 추가. * Object pop() : stack에서 객체 꺼냄. 리턴. stack에서 객체 제거 * Object peek() : stack에서 객체를 조회. * Queue 인터페이스 : FIFO (First in First out) * LinkedList 클래스가 구현함. * void offer(Object) : 객체를 Queue에 저장. 추가 * Object poll() : 객체를 Queue에서 꺼냄 저장. 리턴. Queue에서 제거 * Object peek() : Queue에서 객체를 조회. * * LinkedList : Q..
-
객체 지향 용어 정리.국비 교육 내용 정리 2023. 6. 12. 10:31
=======================class란 * 클래스 : 사용자 정의 자료형. * 속성 : 멤버변수 * 기능 : 멤버메서드 * 생성자란 ? * 객체화시 호출되는 메서드 * 생성자 없이 객체 생성은 불가함. * 기능은 인스턴스 변수의 초기화 담당함. * 생성자도 오버로딩이 가능하다. * 생성자 구현 * 1. 생성자의 이름은 클래스명과 같다. * 2. 리턴타입을 기술하지 않는다. * * 기본생성자 * 클래스에 생성자를 하나도 구현하지 않으면 컴파일러가 추가해주는 생성자 * public 클래스명(){} 형태임 * 초기화 블럭 예제 * static 초기화 블럭 : * 주요기능 : 클래스 변수의 초기화 * 실행시기 : 클래스 정보가 로드 되고, 한번 실행. * 인스턴스 초기화 블럭 * 주요기능 : 인스..
-
-
2023년 06월 05일 수업 내용 정리국비 교육 내용 정리 2023. 6. 7. 09:30
package ch06.obj1; public class MemberCallEx1 { static int cv1 = 10; static int cv2 = cv1; // 클래스멤버간 호출 int iv1 = 100; int iv2 = iv1; // 인스턴스멤버간 호출 int iv3 = cv1; // 인스턴스멤버에서 클래스 멤버 호출 // static int cv3 = iv1 //클래스 멤버에서 인스턴스 멤버 호출. => 객체화 필요 static int cv3 = new MemberCallEx1().iv1; public static void main(String[] args) { // cv2 = iv1; // 클래스 멤버인 main 메서드에서 iv1 인스턴스멤버 접근 불가 cv2 = new MemberCall..
-
2023년 06월 01일 수업내용 정리국비 교육 내용 정리 2023. 6. 1. 15:41
[ 배열을 통한 숫자 출력] [코드값] package ch05.array; import java.util.Scanner; public class numMakeQuiz { public static void main(String[] args) { String neonNumber[][] = { { "*****", "* *", "* *", "* *", "*****" }, { " ** ", " * ", " * ", " * ", " *** " }, { "*****", " *", "*****", "* ", "*****" }, { "*****", " *", "*****", " *", "*****" }, { " ** ", " * * ", "* * ", "*****", " * " }, { "*****", "* ", "**..
-
2023년 05월 31일 공부 내용 정리 ( java)국비 교육 내용 정리 2023. 5. 31. 09:49
Quiz) /* * 화면에서 5개의 점수를 입력받아서 점수의 합계, 평균, 최대점수, 최소점수 출력하기 * 입력받는 점수는 score 배열에 저장하기. */ public static void main(String[] args) { Scanner scan = new Scanner(System.in); int[] score = new int[5]; } 코드값: package ch05.array; import java.util.Scanner; public class quiz1 { public static void main(String[] args) { // TODO Auto-generated method stub /* * 화면에서 5개의 점수를 입력받아서 점수의 합계, 평균, 최대점수, 최소점수 출력하기 * ..
-
2023년 05월 30일 공부 내용 정리 ( java)국비 교육 내용 정리 2023. 5. 30. 12:03
[배열] package ch05.array; public class ArrayEx01 { public static void main(String[] args) { int[] arr1; int arr2[]; //1. 비열 참조 변수 선언 // 2. 배열 객체 생성(instance) arr1 = new int[5]; arr2 = new int[5]; //int형 저장공간을 5개 생성, 기본값(0)으로 초기화 // 3. 배열값을 초기화 arr1[0] = 10; arr1[1] = 20;\ arr1[2] = 30; arr2 = arr1; arr2[4] = 50; // 4. 배열 출력 System.out.println("arr1 배열:"); for (int i = 0; i
-