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 do negative exponents mean?
What does singleton mean in java?
What is e in java?
Lowest Common ancestor in a Binary Search Tree and Binary Tree.
When should we create our own custom exception classes?
Differentiate between static and non-static methods in java.
What is java developer skills?
What is this keyword in java?
How you can force the garbage collection?
Give me some null interfaces in java?
how can you take care of mutual exclusion using java threads? : Java thread
What is another word for methodology?
From the two, which would be easier to write: synchronization code for ten threads or two threads?
What is nullpointerexception?
What is the difference between sop and work instruction?