Comparisons or Relational and boolean operators in Java Programming
Previous | Home | Next |
Relational Operators are important to any programming language to make comparisons between values.
Boolean operators perform logic operations between multiple relational statements.
Relational operators are operators that compare quantities.
Greater than (>)
Greater than or Equal to (>=)
Less than (<)
Less than or Equal to (<=)
Equal to (==)
Not Equal to (!=)
Boolean Operators are operators that define the relationship between relational statements and allow multiple relational statements to be joined.
NOT (!) - Performs the negation of a statement (True changed to false, false changes to true)
AND (&&) - Performs the conjunction of two statements.
OR (||) - Performs the disjunction of two statements.
RELATIONAL OPERATOR
public class RelationalOperators
{
public RelationalOperators()
{
int x = 20 y = 10, z ;
z=x+y;
System.out.println(" x > y: " +(x>y));
System.out.println(" x < y :" + (x<y));
System .out.println(" x>= y :"+ (x>=));
public static void main (String arg[])
{
new Relationaloperators();
}
Previous | Home | Next |