A break statement of the break <return value> form is referred to as an extended break statement.
A traditional switch construct uses a break statement without any return values in its switch branches, to take control out of a switch construct. This also <indexentry content="break:comparing, with break ">prevents fall through the control <indexentry content="break :comparing, with break">across multiple switch branches. A switch expression uses a break statement with a return value and breaks out of switch expressions.
Let's compare the break statement with the return statement, which can be used with or without a value. In a method, you can use a return statement to return a value and exit a method or just exit a method without returning a value. Here's a quick example:
int sum(int...