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 are the types of inner classes (non-static nested class) used in java?
What is %02d?
What about interrupt() method of thread class ?
What are implicit objects in java?
What are the four pillars of java?
How do I compare two strings in word in java?
What is arraylist e in java?
Why is boolean important?
Can java cast null?
Considering notepad/ie or any other thing as process, what will happen if you start notepad or ie 3 times? Where 3 processes are started or 3 threads are started?
How do you declare a variable?
Can I overload to string method
What do you know about the garbage collector in java?
what is an objects lock and which objects have locks? : Java thread
What is the difference between Grid and Gridbaglayout?