1 2 3 4 5 6 7 | private void example() { int j= 10 for ( int i= 0 ; i< 10 ; i++) { j=j – i; } |
Can you tell me what the following code would do to the values of i and j?
1 2 3 4 5 6 7 | private void example() { int j= 10 for ( int i= 0 ; i< 10 ; i++) { j=j – i; } |
1 | Systm.out.println( "i: " +i+ " j: " +j); |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | public void act() { exampleAgain(); // Add your action code here. } private void exampleAgain() { int j= 10 ; for ( int i= 0 ; i< 10 ; i++) { j=j-i; getWorld().addObject( new Bee(), 200 , 200 ); } } |