Java Tutorial 11 --- "Relational and Logical Operators"

 Java Tutorial 11 --- "Relational and Logical Operators"

DOC --- 



CODE --- 

package com.company;

public class Tut11 {
public static void main(String[] args) {
// Relational and Logical Operators

System.out.println("For Logical AND.....");
Boolean a = true;
Boolean b = true;
Boolean c = true;

if(a && b && c){
System.out.println("Y");
}
else {
System.out.println("N");
}


System.out.println("For Logical OR.....");
Boolean d = true;
Boolean e = false;
Boolean f = true;

if(a && b || c){
System.out.println("Y");
}
else {
System.out.println("N");
}

System.out.println("For logical NOT....");
System.out.println("Not A is - " + !a);
System.out.println("Not B is - " + !b);

}
}

Comments

Popular posts from this blog

JAVA Practice Set 2

Java Practice Set 4

Introduction to Java + Installing Java JDK and IntelliJ IDEA for Java