JAVA 멘토씨리즈 3

JAVA Eclipse 15 배열의 복제, for ~ each문

배열의 복제 System.array(src, srcPos, dest, destPos, length); src : 복사할 배열 srcPos : 복사를 하기 시작힐 인덱스(위치) dest : 덮어 쓸 배열 destPost : 덮어쓰기 시작할 인덱스(위치) length : 복사할 길이 ex. import java.util.Arrays; public class array { public static void main(String[] args) { int [] a = {1, 2, 3, 4, 5, 6}; int [] b = {0, 0, 0, 0, 0, 0, 0, 0}; System.out.println(Arrays.toString(a)); System.out.println(Arrays.toString(b)); Sy..

JAVA Eclipse 11 제어문 : 반복문의 break, continue

제어문: 조건문, 반복문 반복문의 break : 반복문 내에서 어떠한 조건에 의해 반복을 멈추고 싶을 때 반복문의 break 구조 while (조건식) { 반복할 명령; break; } * 조건식 : true 또는 false의 결과값을 갖는 식 -> 특정 조건이 되면 반복문을 멈춘다 반복문의 continue : 아래의 명령을 무시하고 다음 반복 실행 반복문 continue의 구조 반복문 { if (다음 반복을 실행할 조건){ continue; } continue 아래의 조건을 무시하고 다시 처음으로 돌아간다 JAVA Eclipse 01 프로그램, 프로그래밍, 기계어, JAVA https://developernew.tistory.com/63 JAVA Eclipse 02 자바 출력메서드와 입력메서드 http..

JAVA Eclipse 06 기타연산자 - 삼항연산자, 대입연산자, 복합대입연산자, instanceof

기타연산자 종류 삼항 연산자 : 항이 3개인 연산자 ( 단항 연산자) (조건)? 참일때값 : 거짓일때값 ex1. int age = 18; System.out.println(age>19? "성인입니다" : "청소년입니다"); 출력화면 ex2. import java.util.Scanner; public class Traffic_Light { public static void main(String[] args) { Scanner sc = new Scanner(System.in); System.out.println("신호등 입력 프로그램"); System.out.println("빨간불 : 1, 초록불 : 2, 노란불 : 3"); int sign = sc.nextInt(); String result=sign==1..