hello guys, i am very new here.
public class quiz{
public static void main (String args[]){
for (byte i = 1; i <= 5; i++){
for (byte j = 1; j <= i; j++){
System.out.println(i);
}
System.out.println();
}
}
}
I can't simply explain that code. and it gives me an output of this:
1
2
2
3
3
3
4
4
4
4
5
5
5
5
5
why does it print two '2s' when variable i will be two??
kindly explain.
advance thank you :))
by the way, I am just a student, I want to read your posts here, and some tutorials, they are just interesting :)