try the foll code : class TeastClass { public static void main(String args[ ] ) { int k = 0; int m = 0; for ( int i = 0; i <= 3; i++) { k++; if ( i == 2) { // line 1 } m++; } System.out.println( k + ", " + m ); } } // which statements are correct when inserted at line //1 // 1. break; will print 3,2 // 2. continue; will print 4,3 // 3. i = 4; will print 3,3 // 4. continue; will print 3,2 // 5. i = m++; will print 4,4
natarajan meghanathan
Ranch Hand
Joined: Feb 01, 2001
Posts: 130
posted
0
I don't think it is tough. basically u have to plug and play each option. Options 1,2,3 are correct. option 5 is little bit catchy. but it will print 4,5 not 4,4. thats the only thing u need to be careful.