List相关
list. stream ( ) . mapToDouble ( i -> i) . sum ( ) ;
list. sort ( Comparator . comparingInt ( o -> o) ) ;
list. stream ( ) . distinct ( ) . count ( )
Math相关
Math . floor ( )
Math . abs ( )
BigInteger类:
abs ( ) 返回其值是此BigInteger 的绝对值的BigInteger 。
compareTo ( BigInteger val) 将此BigInteger 与指定的BigInteger 进行比较。
divide ( BigInteger val) 返回其值为 ( this / val) 的BigInteger 。
pow ( int exponent) 返回其值为 ( thisexponent) 的BigInteger 。
multiply ( BigInteger val) 返回其值为 ( this * val) 的BigInteger 。
gcd ( BigInteger val) 返回一个 BigInteger ,其值是 abs ( this ) 和 abs ( val) 的最大公约数。
subtract ( BigInteger val) 返回其值为 ( this - val) 的 BigInteger 。
BigDecimal类:
new BigDecimal ( String val)
abs ( )
add ( BigDecimal augend)
compareTo ( BigDecimal val)
divide ( BigDecimal divisor, int scale, int roundingMode)
CEILING
DOWN
FLOOR
HALF_DOWN
HALF_EVEN
HALF_UP
UNNECESSARY
UP
setScale ( int newScale, RoundingMode roundingMode)
subtract ( BigDecimal subtrahend)
divide ( BigDecimal divisor, RoundingMode roundingMode)
String相关
String . format ( "%08d" , 123 ) ;
String . format ( "%8s" , "abc" ) . replace ( " " , "0" ) ;
String . valueof ( ) . charAt ( 0 ) ;
其他相关
DecimalFormat g1= new DecimalFormat ( "0000000" ) ;
DecimalFormat df= new DecimalFormat ( "0.000000" ) ;
df. format ( ) ;
Arrays
int [ ] ints = Arrays . stream ( stringArr) . mapToInt ( Integer :: parseInt ) . toArray ( ) ;
Interger
Integer . MAX_VALUE;
Interger . MIN_VALUE
Date相关
LocalDate . of ( 1949 , 10 , 1 ) . until ( LocalDate . of ( 2022 , 1 , 1 ) , ChronoUnit . DAYS)