I have the following code
public class Main {
public static void main(String[] args) {
for (int i = 1; i <= 4; i++) {
for (int j = 1; j <= i; j++) {
System.out.print("*");
}
System.out.println();
}
}
}
it prints out a star pattern
*
**
***
****
What is the purpose of System.out.println();
? Why do we put it at the end of the loop?