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
What is continuity of a function?
What is meant by main method?
What is ordered map in java?
How many techniques can be employed to create a string object?
Is main is a keyword?
What is e in java?
What function extracts specified characters from a string?
Explain about interthread communication and how it takes place in java?
Is nullpointerexception checked or unchecked?
Is java a super set of javascript?
What is string :: npos?
How do you reverse a list?
Which collections are thread safe in java?
List some oops concepts in java?
How do you convert boolean to boolean?