Simple nested for loop example

后端 未结 7 517
后悔当初
后悔当初 2021-01-18 01:15

Currently I am studying for my Java test. Whist studying I\'ve come across a small problem.

In this for loop:

for ( int i=1; i <= 3 ; i++ ) {
            


        
7条回答
  •  孤城傲影
    2021-01-18 01:58

    For each iteration of outer loop, complete inner loop will execute. For example when i= 1, inner loop will execute 3 times and you will get 1 1 1 2 1 3

提交回复
热议问题