A variable is a representation of a data storage space, which is the basic unit for storing data.
The data types commonly used in Java are integers (int), double-precision floating-point (double), character (char), and string-type (string).
Variables must be declared and assigned first, as follows.
- Assignment operator (=)
- Arithmetic operators (+,-, *,/,%).
- The relational operator (<,>=,>,<=,==,!=).
Data type conversions are designed to facilitate operations between different types of data.
Data type conversions include automatic type conversions and forced type conversions, which must meet certain conditions when automatic type conversions occur.
Boolean is used in Java to represent true and false, and two values of Boolean type are real and false.
The use of relational operators in Java can be used to compare sizes. High and low. The result after comparison is the Boolean type.
Java provides the scanner class to get the information entered on the keyboard from the console.
Java Understanding Program Logic