what is the replacement for GOTO in java?
Answers were Sorted based on User's Feedback
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 |
What is static in java?
explain what is transient variable in java?
What is quick sort in java?
What will happens if you opened Internet Explorer 4 times?
What is the mapping mechanism used by java to identify IDL language?
How many types of keywords are there?
Define jit compiler?
How do you pass by reference?
What is a for loop in java?
How do generics work in java?
Define interface in java?
What is close method? How it's different from Finalize & Dispose?
0 Answers InfoAxon Technologies,