Skip to content

Commit 7bd639e

Browse files
committed
operators completed
1 parent 85e4b02 commit 7bd639e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/Operators/AssignmentOperator.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,22 @@ public static void main(String args[]){
99
System.out.println(a);
1010
System.out.println(b);
1111
}
12+
public static void Example2(String[] args){
13+
int a=10;
14+
a+=3;//10+3
15+
System.out.println(a);
16+
a-=4;//13-4
17+
System.out.println(a);
18+
a*=2;//9*2
19+
System.out.println(a);
20+
a/=2;//18/2
21+
System.out.println(a);
22+
}
23+
public static void AddingSort(String args[]){
24+
short a=10;
25+
short b=10;
26+
//a+=b;//a=a+b internally so fine
27+
//a=a+b;//Compile time error because 10+10=20 now int
28+
System.out.println(a);
29+
}
1230
}

0 commit comments

Comments
 (0)