Skip to content

Commit 0c5eae2

Browse files
committed
f
1 parent a82585f commit 0c5eae2

6 files changed

Lines changed: 128 additions & 34 deletions

File tree

JavaTest/.idea/workspace.xml

Lines changed: 98 additions & 34 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
948 Bytes
Binary file not shown.
452 Bytes
Binary file not shown.
402 Bytes
Binary file not shown.

JavaTest/src/AddNo.java

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
public class AddNo {
2+
3+
public static void main(String args[]){
4+
System.out.println(AddNo.Add1(3,0));;
5+
}
6+
public static int Add1(int num1,int num2) {
7+
Integer i1=new Integer(num1);
8+
Integer i2=new Integer(num2);
9+
//int[] a=null;
10+
return Math.addExact(i1,i2);
11+
}
12+
13+
public static int Add2(int num1,int num2) {
14+
int tem=0;
15+
while(num2!=0){
16+
tem=(num1&num2)<<1;
17+
18+
num1=num1^num2;
19+
num2=tem;
20+
}
21+
return num1;
22+
23+
}
24+
}

JavaTest/src/Testxor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ public static void main(String args[]){
1818

1919
System.out.println(s1==str);
2020
System.out.println(s2==str);
21+
22+
switch(s1){
23+
case "test" : {s2=s2+s1;s2=s3+s2;}
24+
case "s":s2=s2+s2;
25+
default :s2=s2;
26+
}
2127
}
2228

2329

0 commit comments

Comments
 (0)