Array2 [JAVA] 2-8.1~8.2 종합응용 2 (배열, 조건문, 반복문, scanner) 부스트코스 생활코딩 [쉽게 배우는 자바2] 공부 기록 2-8.1 종합응용 1 package javaChapter2_8; public class AuthApp3 { public static void main(String[] args) { String[] users = {"egoing", "jinhuck", "youbin"}; String inputId = args[0]; boolean isLoginged = false; for (int i = 0; i < users.length; i++) { String currentId = users[i]; if (currentId.equals(inputId)) { isLoginged = true; break; } } System.out.println("Hi,"); if.. 2022. 2. 5. [JAVA] 2-7.1~7.3 반복문 (while, for) 배열 (Array) 부스트코스 생활코딩 [쉽게 배우는 자바2] 공부 기록 2-7.1 반복문 (Looping statement) package javaChapter2_7; public class LoopApp { public static void main(String[] args) { System.out.println(1); System.out.println("=== while ==="); int i = 0; while (i < 3) { System.out.println(2); System.out.println(3); // i = i + 1; i++; } System.out.println("=== for ==="); for (int j = 0; j < 3; j++) { System.out.println(2); System.o.. 2022. 2. 4. 이전 1 다음