Skip to main content

Posts

Showing posts with the label operators in java

Operators

Operators:- operators are used to perform some logical or mathematical operations. Types of Operators:- 1.      Arithmetic Operator (a)   Binary Arithmetic (b) Unary Arithmetic 2.      Relational Operator 3.      Logical operator 4.      Bitwise operator 5.      Ternary or conditional operator 6.      instanceof  operator 7.      comma operator 8.      assignment operator 9.      dot operator Binary Arithmetic:- Binary arithmetic operator operates on two operands. Operators are +,-,*, /, %.example like 5+2, 5-2, 5*2, 5/2, 5%2. Example1:- TestOperator.java class TestOperator { public static void main(String[]args) { int a=10,b=5; System.out.println("Addition:"+(a+b)); System.out.println("Subtraction:"+(a-b)); System.out.println("Multiplication:"+(a*b)); ...