Operators in Java Programming

Operators in Java Programming

Previous Home Next

 

Operators are used to manipulate primitive data types.java provide a set
 of operators that can be used to perform an action on one or two 
operands.an operator that can operate on one operator is called unary 
operand and an
operator which can operate on two operands is called binary operator.

java operators are divided in different  categories.
Assignment, arithmetic ,relational ,logical,bit wise,compound assignment, and conditional
Assignment operator is =
Arithmetic operators are +, - ,/, *, %, ++, --
Relational operators > ,<, >= ,<= ,!=, ==
Logical operators. &&, | | , !.
Compound assignment operators +=, -=, *=, /=, %=,<<==,>>==.
Conditional operators ?:
 



  

 
public class ArithmeticOperators
{

public ArithmeticOperators()
{
int x = 20 y = 10, z ;
z=x+y;
System.out.println("+ operator resulted in " +z);
public static void main(String arg[])

{
new Arithmeticoperators();
}
}



Previous Home Next