boolean Data Type
The data type boolean has only two values: true and false. These are called thelogical (Boolean) values. The central purpose of this data type is to manipulate logical (Boolean) expressions.
An expression that evaluates to true or false is called a logical (Boolean) expression.
Floating-Point Data Types
The floating-point data type deals with decimal numbers. To represent real numbers, Java uses a form of scientific notation called floating-point notation.
The data types float and double are used to manipulate decimal numbers. Floats represent any real number between –3.4E+38 and 3.4E+38. The memory allocated for the float data type is 4 bytes. Doubles are used to represent any real number between –1.7E+308 and 1.7E+308. The memory allocated for the double data type is 8 bytes.
The maximum number of significant digits in float values is 6 or 7, while the maximum number of significant digits in double values is 15.
No comments:
Post a Comment