Answer Posted / devesh dashora
break with label and continue with label.
1. Break with label
loop1: for (int i = 0; i < 10; i++)
{
loop2: for ( int j = 0; j < 10; j++)
{
System.out.println(i);
if( i + j > 10 )
break loop1;
}
}
2. continue with label
loop1: for (int i = 0; i < 10; i++)
{
loop2: for ( int j = 0; j < 10; j++)
{
if(i + j == 5)
continue loop1;
System.out.println(j);
}
}
| Is This Answer Correct ? | 12 Yes | 20 No |
Post New Answer View All Answers
Can we override constructors?
Is it compulsory for a try block to be followed by a catch block in java for exception handling?
What is int lol?
What is the difference between the ">>" and " >>>" operators in java?
What are the parts of methodology?
What are the types of methodology?
What is functional interface in java example?
What is a method in coding?
What restrictions are placed on method overriding in java programming?
What are singleton services?
What is numel matlab?
What is the use of accept () method in java?
What is function and its uses?
How to obtain a performance profile of java program
What is the difference between exception and error in java?