Multiple Choice Question

Quiz Guidelines

 

QID: 
168
Question: 

Given the following code, which of these statements are true?

class TestClass{
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 );
}
}

Select 3 options

A. It will print 3, 2 when line 1 is replaced by break;
B. It will print 3, 2 when line 1 is replaced by continue.
C. It will print 4, 3 when line 1 is replaced by continue.
D. It will print 4, 4 when line 1 is replaced by i = m++;
E. It will print 3, 3 when line 1 is replaced by i = 4;

Q&A Set: