What will the following program print?
public class Main{ public static void main (String [] args){ for : for (int i = 0; i< 10; i++){ for (int j = 0; j< 10; j++){ if ( i+ j > 10 ) break for; } /* ww w. j a v a 2 s .co m*/ System .out.println ( "hello"); } } }
Select 1 option
Correct Option is : B
Note that for is a keyword and so cannot be used as a label.
But you can use any other identifier as a label.