3.4 Java Basics and Control Loops
3.2.6 Boolean Literals
Boolean data type represents either true or false. For example: boolean flag = true;
boolean ready = false.
Note that we cannot use 1 or 0 to represent true or false as
done in C++. Further, observe that true and false are NOT enclosed in quotes.
3.2.7 Symbolic Constants
Many a times, we need to use symbolic constants such as PI, to represent 3.141519 that remains
constant through out the program. A symbolic name substitutes a sequence of characters or a
numerical value that follows it. Symbolic names are written in capital letters as a convention. We
use declaration final and its syntax and examples are shown below:
final data_type symbolic_name = value ;
final double PI = 3.14159; final ...