Understanding transfer Statements in Java: A Comprehensive Guide


By using transfer statements we are able to transfer the flow execution from one position to another position.


In Java, there are three main types of transfer statements: 

  • Break
  • Continue
  • Return


  • we are able to use the break statement only two places if we are using any other place the compiler will raise compilation error.
  • Break means that stop the execution come out of loop.
    • Inside the switch statement.
    • Inside the loop.


  • skip the current iteration continue the rest of the iteration normally.
  • When encountered inside a loop, it causes the control to immediately jump to the next iteration of the loop, skipping any remaining code within the loop for the current iteration.

Return Statement:

  • The return statement is used to explicitly return from a method.
  • It can optionally return a value to the caller, depending on the method’s return type.
  • When encountered inside a method, it immediately terminates the method’s execution and transfers control back to the caller, along with the specified return value (if any).

Leave a Comment

Your email address will not be published. Required fields are marked *