Write a program illustrate use of various boolean operators in java

Write a program illustrate use of various boolean operators in java. A Java program that demonstrates how to use various Boolean operators.As input, choose any two boolean values. Then, to get the desired output, we use various boolean bitwise operations such as AND, OR, XOR, and NOT. The source code for the Java Program to Demonstrate the Use of Various Boolean Operators can be found here.

import java.util.Scanner;
public class Main
{
public static void main(String args[])
{
Scanner s = new Scanner(System.in);
System.out.print("Enter a:");
boolean a = s.nextBoolean();
System.out.print("Enter b:");
boolean b = s.nextBoolean();
boolean c = a | b;
boolean d = a & b;
boolean e = a ^ b;
boolean f = (!a & b) | (a & !b);
boolean g = !a;
System.out.println("a = " + a);
System.out.println("b = " + b);
System.out.println("a|b = " + c);
System.out.println("a&b = " + d);
System.out.println("a^b = " + e);
System.out.println("!a&b|a&!b = " + f);
System.out.println("!a = " + g);
}
}

Enter a:true
Enter b:false
a = true
b = false
a|b = true
a&b = false
a^b = true
!a&b|a&!b = true
!a = false