4.4. The boolean Type

The boolean data type represents the two logical values denoted by the literals true and false.

Table below lists the range of boolean values in Java.

			package javatutorial;

			/**
			 * Range of boolean types
			 * 
			 * @author f5java.com
			 */
			public class BooleanRange {


				public static void main(String[] args) {
					// 1. Boolean values can only be true of false
					
					boolean truthValue1 = true;
					boolean truthValue2 = false;
			//		boolean value = 5; // Invalid values, compiler wont allow
			//		boolean value1 = "true"; // Invalid values, compiler wont allow
					
					// Printing boolean range
					System.out.println("boolean type can only be " + truthValue1 + " or " + truthValue2);

				}

			}