import java.lang.*;

class Logical_Operators
{
public static void main(String args[])
{
System.out.println(“\nLogical AND : \n”);
System.out.println(“True && True : “+(true&&true));
System.out.println(“True && False : “+(true&&false));
System.out.println(“False && True : “+(false&&true));
System.out.println(“False && False : “+(false&&false));

System.out.println(“\nLogical OR : \n”);
System.out.println(“True || True : “+(true||true));
System.out.println(“True || False : “+(true||false));
System.out.println(“False || True : “+(false||true));
System.out.println(“False || False : “+(false||false));

System.out.println(“\nLogical NOT : \n”);
System.out.println(“! True : “+(!true));
System.out.println(“! False : “+(!false));
}
}

44,417 total views, 68 views today

Get Free Email Updates..!
Join us for FREE to get instant email updates..! GobsInfo- Everything Unlimited
We hate spam. Your email address will not be sold or shared with anyone else.

2,728 Thoughts to “Java Program To Demonstrate Logical Operators”

  1. Hi, i read your blog occasionally and i own a similar one and
    i was just wondering if you get a lot of spam comments?
    If so how do you protect against it, any plugin or anything
    you can advise? I get so much lately it’s driving me insane so any assistance is very much appreciated.

Leave a Comment