전체 글
-
상속JAVA 2023. 12. 7. 22:51
상속 정의 예를들자면 [A클래스] 내부의 멤버(멤버변수,생성자,메소드)를 [B클래스][C클래스][D클래스][E클래스]~~~~[Z클래스]등등 안에서 객체화 없이 자기 멤버처럼 호출할수 있는 관계를 상속이라고 한다. ⭐ 상속관계가 아니라면 반드시 객체화 후 멤버를 호출해야 한다. 위 예시의 상속관계에선 A클래스를 슈퍼클래스라 부르고 B~ Z클래스를 서브클래스라고 부름. 상속관계 코딩형식 슈퍼클래스 형식 [public][abstract] class 슈퍼클래스명 {~} 서브클래스 형식 [public][abstract|final] class 서브클래스명1 extends 슈퍼클래스명{~} ⭐ 슈퍼클래스 선언시 final이 붙으면 절대 안된다 final이 붙으면 서브클래스가 상속할수 없다. 상속의 장점 1개의 슈퍼클..
-
클래스(Class)JAVA 2023. 12. 5. 18:45
java에서 최소단위 프로그램의 한 종류이다. 클래스 내부의 구성요소는 [멤버변수], [메소드], [생성자]이다. package 패키지명; import 수입클래스패키지명.수입클래스명; [public] [abstract|final] class 클래스명{ 멤버변수 생성자 메소드 등등 } 키워드명 의미 package 클래스의 소속 [묶음명]을 지정한다. 패키지란 서로 기능이 비슷하거나 관련이 있는 [클래스] 또는 [인터페이스] 들을 묶어 놓은 묶음이다. import 타 패키지 소속 클래스를 객체화하여 사용할 경우 수입할 패키지명과 클래스명을 지정한다. 0개 이상 선언할 수 있다. 같은 패키지에 있는 타 클래스와 java.lang 패키지 안의 모든 클래스는 수입 코딩 없이도 자동 수입된다. 수입클래스명 대신 *..
-
반복문JAVA 2023. 12. 5. 17:33
설정한 [조건식]이 true면 블록안의 [실행구문]을 [반복수행]하는 구문이다. for 문 for(초기값 설정; 조건식; 증감식){ 실행구문; } [초기값]을 설정한다. (=변수에 숫자대입) 조건식의 결과가 true면 ③으로, false면 반복문 탈출 실행구문을 수행 증감식에서 증감 ②로 이동 처음부터 조건식이 false면 실행구문이 한번도 실행되지 않을 수 있다. 초기설정값, 조건식, 증감식은 각자 생략가능하나, 조건식과 증감식이 잘못 설정하면 무한루프에 빠진다. 무한루프란 반복문에서 빠져 나오질 못한다.즉 무한반복. while 문 while(조건식){ 실행구문; } 조건식의 결과가 true면 ②로, false면 반복문 탈출 실행구문 수행 ① 로 이동 처음부터 조건식이 false면 실행구문이 한번도 실..
-
조건문JAVA 2023. 12. 5. 16:59
설정한 [조건식]이 true일 경우에만 설정한 [실행구문]을 수행하는 문장이다 비교연산자와 논리연산이 반드시 등장함 조건식이란 true또는 false를 리턴하는 [비교연산식]또는 [논리연산식]을 의미한다 설정한 [조건식]이 true일 경우에만 설정한 [실행구문]만 실행하므로 [프로그램의 흐름]을 제어할수 있다. 조건문 종류에는 if 문 , switch 문이 있다. if 문 📌형식1 if ~ else if ~ else 구문 👉if 구문 1개 , else if 구문1개 이상 , else 구문 1개 가 차례로 나오는 형식 if (조건식 1) {실행구문1;} else if (조건식 2) {실행구문2;} ~ else if (조건식 n) {실행구문n;} else {실행구문 m;} 조건식n 이 true 면 실행구문x..
-
오라클 자료형SQL(Oracle) 2023. 12. 1. 18:10
자료형(Data type) ▶ 컬럼(column)에 입력되는 데이터의 유형을 말한다. ▶ 문자형, 숫자형, 날짜형 등이 있다. 종류 해석 CHAR(s) ▶ [고정길이] 문자열 저장. s는 byte 수를 의미 ▶ 설정 크기보다 입력 문자 크기가 작으면 나머지는 [공백]으로 남는다 ▶ 최대 크기는 2000byte (영문 2000자 한글 1000자) ▶ 설정 크기보다 입력 문자 크기가 크면 행 자체가 입력되지 않는다. 예) char(4) 문자 4byte까지 입력가능 즉 영문4개 한글 2개까지 가능 char는 char(1)과 동일. VARCHAR2(s) ▶ [가변길이]문자열 저장. s는 byte 수를 의미 ▶ 설정크기보다 입력문자 크기가 작으면 크기가 자동으로 줄어든다. ▶ char와 달리 뒤에 공백이 안생긴다..
-
연산자JAVA 2023. 12. 1. 14:28
연산자(operator)란? 💥[데이터]를 처리하기 위한 [각종기호]를 의미한다 사칙연산자 💥산술연산자라고도 하며, 변수에 데이터를 계산하는 연산자를 말한다. 계산한 숫자값을 반환 종류 의미 사용예 리턴값 + 좌우 숫자 더한 결과 리턴 3+5 8 - 좌우 숫자 뺀 결과 리턴 6-2 4 * 좌우 숫자 뺀 결과 리턴 4*8 32 / 좌측 숫자를 우측 숫자로 나눈 몫을 리턴 8/2 4 % 좌측 숫자를 우측 숫자로 나눈 후 나머지를 리턴 7%3 1 대입연산자 💥변수에 데이터를 입력하는 연산자를 말한다. 종류 예 해석 = int age = 4; 변수 age에 데이터 24저장하기 += int age = 4; age += 2; 기존변수 age에 안에있는 데이터에 2를 덧셈하여 갱신하라 -= int age = 4; a..
-
오라클 계정SQL(Oracle) 2023. 11. 30. 18:21
오라클에서 계정이란? ★오라클 서버에 접속하는 사용자를 말한다. 오라클 계정으로 로그인이 성공하려면 비밀번호도 입력해야한다. 계정마다 [권한]을 다르게 줄 수 있다. 계정의 권한 부여는 데이터베이스 관리자가 주는거다 계정과 아이디의 차이점 사용자에 따라 [권한]이 다르다면 [계정] 사용자에 따라 [권한]이 같다면 [아이디] ★오라클은 다수의 클라이언트에게 동시에 정보를 제공하는 서버이므로 서버의 특징인 계정과 암호를 가지고있다. 오라클에서 계정종류 sys 오라클 설치 시 기본적으로 만들어지는 계정. 모든 것을 할 수 있다. 최종 관리자 계정이고 비밀번호 노출 시 모든 데이터를 날릴 수 있음. system 오라클 설치 시 기본적으로 만들어지는 계정. [데이터베이스]라는 객체 생성 권한이 없다. 최종 관리자..