Friday 7 November 2014

Boolean Example in Java

Structure of the Problem Requirements 

In this problem we will learn how to use boolean values in Java program. The boolean value has two two state true or false 1 or 0. Mostly boolean value is used to check the condition and to avoid number of Key stoke in Code. In this problem a boolean value in initialized with true condition and through this print a String. Here is the source code of this problem which help you in better understanding. 

Source Code   

import java.util.Scanner;
public class Bool_Fun  
{
public static void main(String[] args)
{
System.out.println("\t \t \t LEP Tutorials \n ");
Scanner input = new Scanner (System.in);
boolean LEP = true;
if (LEP ==true)
{
System.out.println("LEP Java Tutorials \n ");
}
else 
{
System.out.println("LEP C++ Tutorials \n ");
}
}
}

Output of the Program

Boolean Example in Java
Boolean Example in Java

Share it Please
asad

About Author!

Asad Niazi is Software Engineer , Programmer, Web Developers and a young mentor of Tech Solutions Desk and Blogging Solutions . Asad Love to writes about Technology, Programming, Blogging and make money online.

0 comments:

Post a Comment