Hi, jayakumar
Answer c may be wrong.The compiler fails to compile only when
there is 'continue' key
word only inside a case.Try the following code.
public class Test1 {
public static void main(
String args[]) {
int i = 5;
loop:for(int j=0;j<10;j++){
switch( i ){
case 4:
break;
case 5:
//inserted for knowing what is going inside.
//if U uncomment, donot forget to add { }
//{System.out.println("Inside case 5 : for loop i : "+i);
continue loop;
//if continue without loop and for loop the compiler rejects
default:
System.out.println("Hello World!");
}
System.out.println("end of for loop i : "+i);
}
}
}
the variant of continue works here.so the otion 'c' may be wrong.
Cindy Glass, correct me if I am wrong.
Regards,
vkswami