June 2018
Beginner
722 pages
18h 47m
English
A statement is a language construct that can be compiled into a set of instructions to a computer. The closest analogy from everyday life to a Java statement is a sentence in the English language, a basic unit of language that expresses a complete thought. Every statement in Java must end with a ; (semi-colon).
Here is an example of a declaration statement:
int i;
The preceding statement declares a variable i of type int which stands for integer (see Chapter 5, Java Language Elements and Types).
Here is an expression statement:
i + 2;
The preceding statement adds 2 to the value of the existing variable i. When declared, an int variable is assigned a value of 0 by default, so the result of this expression is 2, but it is not ...
Read now
Unlock full access