0% found this document useful (0 votes)
4 views

Practical2.1Java

The document presents a Java program that performs logical operations using boolean variables. It initializes two boolean values, 'a' and 'b', and evaluates their logical AND and OR results. The output displays the values of 'a', 'b', and the results of the operations 'a & b' and 'a | b'.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Practical2.1Java

The document presents a Java program that performs logical operations using boolean variables. It initializes two boolean values, 'a' and 'b', and evaluates their logical AND and OR results. The output displays the values of 'a', 'b', and the results of the operations 'a & b' and 'a | b'.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Practical- No: 2

Write programs to evaluate different types of expressions :

CODE:

class Logi

public static void main(String args[])

System.out.println("Perforrming Logical Operations:");

Boolean b;

a=true;

b=f al se;

boolean x, y;

x=a&b;

y=a|b;

System.out.println("The a is " +a);

System.out.println("The b is " +b);

System.out.println("The a & bis " +x);

System.out.println("The a | bis "+y);

}
Output:-

You might also like