# 중첩 반복문 #### CODE <a class='btn btn-default' href='/codes/44834'>Link</a> ``` public class Matrix { public static void main(String[] args) { // 입력값 받기 int r = Integer.parseInt(args[0]); int c = Integer.parseInt(args[1]); // 매트릭스 출력 printMatrix(r, c); // (0, 0) ~ (3, 7) } public static void printMatrix(int rowMax, int columnMax) { for(int i = 0; i < rowMax; i++) { for(int j = 0; j < columnMax; j++) { System.out.printf("* "); } System.out.println(); } } } ``` #### INPUT ``` 3 7 ``` #### OUPUT ``` * * * * * * * * * * * * * * * * * * * * * for 문 안에는 똑같이 System.out.printf("* ") 가 있는데 왜 마지막에는 System.out.println();을 해주나요??
## print() vs println() 두 메소드는 비슷하지만 차이가 있는데요. `println()`을 빼고 실행시켜보면 차이가 눈에 보이실겁니다
다르게 나오긴 하는데요 정확히 println이 어떻게 영향을 미치는지는 잘 모르겠네요... 설명 부탁드립니다!!
저도 설명 부탁드려요 다르게 나오는건 아는데 정확히 어떻게 영향을 미치는지는 잘 모르겠어요
println은 엔터가 추가되고, 그냥 print는 엔터(줄 개행)가 되지 않습니다.