-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOperators_in_java.java
More file actions
37 lines (27 loc) · 930 Bytes
/
Operators_in_java.java
File metadata and controls
37 lines (27 loc) · 930 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
public class Operators_in_java{
public static void main(String[] args) {
// Arithmetic Operators
// Binary (2 operands needeed)
// + , - , * , / , %
int a = 10;
int b = 5;
System.out.println("Addtion(+) : " + (a + b));
System.out.println("Subtraction(-) : " + (a - b)) ;
System.out.println("Multiplication(*) : " + a * b);
System.out.println("Division(/) : " + a / b);
System.out.println("Modulo(%) : " + a % b);
// Unary ( 1 operands )
// Increment and decrement
// ++ and --
// post and pre
// a++ and ++a
int c = 10;
int d = c++ ;
System.out.println(c);
System.out.println(d);
// Relation Operators
// Logical Operators
// Bitwise Operators
// Assignment Operators
}
}