Page Stats
Visitor: 296
Java Jumping Statement
Jumping statements are used to pass the control to the beginning or end of the program block
Types of Jumping Statements are:
- Break
- Continue
- Return
Break
Break is mostly use inside a loop. It will terminate a loop in between the execution.
Continue
Continue statement is use to skip the statements but control remain in execution.
Return
Return is mostly used to return the control back to the function call. It can return with or without value.
Labeled loop
Loop1: for (i=1; i<=10; i++) { Loop2: for (j=1; j<=10; j++) { System.out.println("hello"); if (j==5) break loop1; } }
hello 4 times.