while

    반복문 while

    while 문 조건을 만족시키는 동안 스코프 { }를 반복 수행 반복 횟수를 모를 때 주로 사용 while (조건식) { // 조건에 만족할 시 반복 수행 } exit 입력 시 프로그램 종료 public void method2() { String sInput = ""; Scanner s = new Scanner(System.in); while(sInput.equalsIgnoreCase("exit")) { System.out.printf("Insert String: "); sInput = s.nextLine(); System.out.println(sInput); } System.out.println("Bye~!"); } 출력물 Insert String: asdf asdf Insert String: EXIT..

    반복문(제어문)

    반복문 프로그램 수행 흐름을 바꾸는 역할을 하는 제어문 조건을 만족하는 동안 스코프 { }를 반복 수행 종류 for 문 중첩 for문 while 문 do ~ while 문