Docy

Boolean Types

Estimated reading: 1 minute 841 views

Boolean Types

A boolean data type is declared with the boolean keyword and can only take the values true or false:

Example

				
					boolean isJavaFun = true;
boolean isFishTasty = false;
System.out.println(isJavaFun);     // Outputs true
System.out.println(isFishTasty);   // Outputs false


				
			

Leave a Comment

Share this Doc
CONTENTS