전체
-
반복문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..