March 2019
Intermediate to advanced
242 pages
6h 21m
English
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 ...
Read now
Unlock full access