Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


what is the replacement for GOTO in java?

Answers were Sorted based on User's Feedback



what is the replacement for GOTO in java?..

Answer / firoz

continue

Is This Answer Correct ?    10 Yes 17 No

what is the replacement for GOTO in java?..

Answer / 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

More Core Java Interview Questions

What is an interoperable application in java ?

0 Answers   HCL,


Explain the difference between map and flatmap stream operation?

0 Answers  


Is Java is 100% pure OOPS? Explain?

27 Answers   ANZ,


What is the requirement of thread in java?

0 Answers  


What are the main differences between the java platform and other platforms?

0 Answers  


What classes of exceptions may be thrown by a throw statement?

0 Answers  


What’s the difference between constructors and other methods?

0 Answers  


Can we call virtual funciton in a constructor ?

0 Answers   XX,


Explain about method local inner classes or local inner classes in java?

0 Answers  


What is super constructor?

0 Answers  


Define nashorn in java8.

0 Answers  


Can a static class have a constructor?

0 Answers  


Categories