Showing posts with label semi-colon. Show all posts
Showing posts with label semi-colon. Show all posts

Tuesday, March 27, 2012

Statement terminators: Semi-colon ;

;

The semi-colon character ends a statement. It separates statements just as the curly braces separate code blocks.



You do not add semi-colons to class declarations, method signatures, if staetment conditions, loop conditions or Switch conditions.

Code blocks: Curly braces

{...} encloses classes, methods and other blocks of Java code.

There is always one top set of curly braces that belong to the class declaration. Placing your cursor next to a semi-colon (in Eclipse) will cause the matching curly to be highlighted.



Example class showing curly braces used to create code blocks