The break statement can also be employed by itself to provide a civilized form of the goto statement. Java does not have a goto statement, because it provides a way to branch in an arbitrary and unstructured manner. This usually makes goto-ridden code hard to understand and hard to maintain. There are a few places where the goto is a valuable and legitimate construct for flow control. Java defines an expanded form of break statement. By using this form of break, you can break out of one or more blocks of code. These blocks need not be a part of a loop or switch.
Thursday, November 27, 2008
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment