O'Reilly logo

Just Java™ 2, Fifth Edition by Peter van der Linden

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 7. Java Statements

Java Statements

Statements are the way we get things done in a program. Statements live in methods and in blocks. Any statement may be prefixed by a label, as shown here:

months: for(int m = 1; m <= 12; m++) { ... 

The general syntax for a statement is this:

optIdentifier: statement 

Java doesn’t have a goto statement. If a label appears, it is either just empty documentation (rare—use a comment instead), or it is used ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required