8:49 pm - Thursday April 25, 2019

Java program using Boolean

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044

/**

*@author :CandidJava.com

*@descriptions : This example shows how to use Boolean [True,False] to iterate in Java program.

*/

<strong> </strong>class Boolean{

public static void main(String[] args) {

boolean b1 = true;

boolean b2 = false;

boolean b3 = (10 &gt; 2)? true:false;

System.out.println("Value of boolean variable b1 is :" + b1);

System.out.println("Value of boolean variable b2 is :" + b2);

System.out.println("Value of boolean variable b3 is :" + b3);

}

}

Output:

D:\ candidjava\code>javac Boolean.java

D:\ candidjava\code>java Boolean

Value of boolean variable b1 is :true

Value of boolean variable b2 is :false

Value of boolean variable b3 is :true

Filed in: Z-A All Java Codes

No comments yet.

Leave a Reply