The matching braces are indicated in color, below:
Notice that in addition to pairs of braces that match,
there are pairs of parentheses ()
, and pairs of brackets []
that
match.
Large programs will have many of these matching pairs,
which are used to group sections of the program together.
class Haiku { public static void main ( String[] args ) { System.out.println( "On a withered branch" ); System.out.println( "A crow has just alighted:" ); System.out.println( "Nightfall in autumn." ); } }
Brace yourself! you have reached the end of the chapter. You may wish to review the following. Click on a subject that interests you to go to where it was discussed.
The next chapter will discuss a way to run the programs in these notes without actually typing them in.