I have found this code as an example but do not understand how it's executed, mainly for the System.out.println() line item.
for ( int i = 1; i <= 5; i++) {
for ( int j = 1; j <= i; j++) {
System.out.print( i );
}
System.out.println();
}
Result:
1
22
333
4444
55555
How does it stack up the numbers?
Also, what is the difference between System.out.print( i ) and System.out.println( i )?
Any explanation would be appreciated, thanks!