-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathClass4.java
More file actions
23 lines (20 loc) · 936 Bytes
/
Class4.java
File metadata and controls
23 lines (20 loc) · 936 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
public class Class4 {
public static void main(String[] args){
int a=10;
int b=5;
System.out.println("Unary 1st Method: " + a++);
System.out.println("Unary 2nd Method: " + ++b);
System.out.println("------------------------");
System.out.println("Binary 1st Method: " + "1+2 = " + 1+2);
System.out.println("Binary 2nd Method: " + "1+2 = " + (1+2));
System.out.println("Binary 3rd method: " + (1+2) + " = 3") ;
System.out.println("--------------------------");
int incremented= ++a*b++ ;
System.out.println("The incremented Values: " + incremented);
System.out.println("------------------------");
System.out.println("Ternary Operations: ");
int Largestnumber= (a>b)?a:b;
System.out.println("The Largest number among a & b is: "+ Largestnumber);
System.out.println("-------------------------");
}
}