Toggle navigation
How To Implement Logic Operators In Java
Rate this article
0 out of 5
In this tutorial we will show you how to implement logic operators in java. After viewing the video tutorial, download the source code and try to modify the code so as to get a feel of what is learned in this video tutorial.
Source Code
LogicOp.java
import java.io.*;
class LogicOp
{
public static void main(String args[])
{
boolean a = true;
boolean b = false;
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);
}
}
Source Code
Download
Author :
TekTips Videos
Joined Date :04-Feb-2013
Articles
Posted
27
Messages
Posted
0
Click Here to See Full Profile
Messages
Posted:
Post Your Comments
Name
(Max 50 Chars)
Comments
Paragraph
Normal
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Formatted
Address
Size
1
2
3
4
5
6
Color
Black
Gray
DarkGray
LightGray
White
Aquamarine
Blue
Navy
Purple
DeepPink
Violet
Pink
DarkGreen
Green
YellowGreen
Yellow
Orange
Red
Brown
BurlyWood
Beige
Design
HTML