The boolean Data Type

A variable of type boolean can contain one of only two values, true or false. These values are also generally known as 1 and 0, with 1 representing true and 0 representing false. However, in Java the value of a boolean type variable is either true or false only; they are not numeric and therefore cannot be assigned from numeric values. The default value for a boolean type variable is false. The keywords true and false can be used to assign values to boolean type variables. For example:

boolean bookIsOnFire = false;       // hopefully boolean thisBookIsGreat = true;     // hopefully you agree



Java 1.4 Game Programming
Java 1.4 Game Programming (Wordware Game and Graphics Library)
ISBN: 1556229631
EAN: 2147483647
Year: 2003
Pages: 237

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net