Skip to content

Commit 548aea0

Browse files
committed
将number对象与参数比较
1 parent 186c29c commit 548aea0

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

mathNum/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
- [x] [加法](src/main/java/com/cpucode/mathNum/addTest/AddTest.java)
1313
- [x] [算术类型](src/main/java/com/cpucode/mathNum/mathTest/MathTest.java)
1414
- [x] [转换为各类型](src/main/java/com/cpucode/mathNum/valueTest/ValueTest.java)
15-
15+
- [x] [将number对象与参数比较](src/main/java/com/cpucode/mathNum/compareTest/CompareTest.java)
1616

1717
- [返回目录](../README.md)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package com.cpucode.mathNum.compareTest;
2+
3+
/**
4+
* 将number对象与参数比较
5+
*
6+
* @author : cpucode
7+
* @date : 2021/12/21 8:51
8+
* @github : https://github.com/CPU-Code
9+
* @csdn : https://blog.csdn.net/qq_44226094
10+
*/
11+
public class CompareTest {
12+
public static void main(String[] args) {
13+
Integer x = 5;
14+
15+
System.out.println(x.compareTo(3));
16+
System.out.println(x.compareTo(5));
17+
System.out.println(x.compareTo(8));
18+
}
19+
}

0 commit comments

Comments
 (0)