Saturday, 3 January 2015

Java Boolean Data Type

Java has a data type boolean. It is used to store boolean values true and false. You can not use zero to represent false or a non-zero value to represent true like C/C++. Boolean values in Java can not be treated like integers and vice-versa.

The size of the boolean data type is undefined but irrespective of the internal storage boolean data type is used to hold just true and false. Boolean values are produced by all relational, conditional and boolean logical operators and are primarily used to govern flow of control during program execution.

No comments:

Post a Comment