Home Help Java F The false Keyword
Questions:Ask|Latest


 
 

Share on Google+Share on Google+

The false Keyword

Advertisement
The false is a keyword, which represents one of the two legal values for a boolean type of variable.

The false Keyword  

     

The false is a keyword, which represents one of the two legal values for a boolean type of variable. It might seem like keyword, but it is actually Boolean literals. The default value of the boolean data type is false. It is seem like keyword; therefore you cannot use them as identifiers in your programs i.e. you cannot declare a variable or class with this name in your Java program.

The syntax of declaring a boolean type variable having false literal is shown as:

  boolean bool = false; 

For example: 

class Check{ 

boolean bool = false;

if (bool){
System.out.println("true");
}
else{
System.out.println("false");
}

Advertisement

Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: November 9, 2009

Ask Questions?    Discuss: The false Keyword  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments
DMCA.com