while문

    [Java] day7. 반복문 while문

    [while문 표현식] 초기식; while(조건식) { 조건식을 만족하는 경우 수행할 구문 (반복할 구문); 증감식; } 예제 )입력한 문자열의 인덱스를 이용하여 문자 하나씩 출력해보기 public void testWhilExample() { Scanner sc = new Scanner(System.in); System.out.print("문자열을 입력하세요 : "); String str = sc.nextLine(); System.out.println("=========== for문 ============"); for (int i = 0; i < str.length(); i++ ) { char ch = str.charAt(i); System.out.println(i + " : " +ch); } Syste..