Tuesday, July 12, 2011

1st Java example of boolean

 Boolean data type only used for true and false, or in other word only use to say that statement is true or false.
In this  program we take (boolean booleanType=false;) boblean data type for (booleanType) and equal this data type to false in next step i apply (if) statement,that if
(booleanType==false) is truse then output is (boolean example data type value :false) which is line 8th in below program.
To understand logical (if and else) operates see java logical operators section in this site.

source code 
  1. class theboolean
  2. {
  3.        public static void main(String[] args)
  4.    {
  5.            boolean booleanType=false;
  6.         if(booleanType==false)
  7.         {
  8.             System.out.println("boolean example data type value :"+booleanType);
  9.         }
  10.     }
  11. }

No comments:

Post a Comment