Statements |
| BASIC |
Lines of Java code are classified as either declarations or statements.
int count;count will be used to hold
integer values. count = 0;count to zero. (Statements are
more accurately called "commands," but this term is rarely used.)Just to confuse things, the two can be combined in an "initializing declaration,"
for example,
int count = 0;or even
String result = someOtherString.substring(0,
5);
(these are still considered declarations).
Here are the types of statements available in Java: