javase
gf970101
这个作者很懒,什么都没留下…
展开
-
java中String类中方法的使用
String s1 = " A b c "; String s2 = "def"; System.out.println(s1+"\n"+s2); //Concat(String str) 连接连个字符串 System.out.println("----------Concat-------------"); System.out.println(s1.concat(s2)); Sys...原创 2020-03-20 09:23:28 · 137 阅读 · 0 评论 -
java中BigDecimal类小数精确计算
BigDecimal b1 = new BigDecimal("10.5"); BigDecimal b2 = new BigDecimal("1.5"); //加法 BigDecimal add = b1.add(b2); System.out.println(add); //减法 BigDecimal subtract = b1.subtract(b2); System.out.prin...原创 2020-03-20 09:21:53 · 134 阅读 · 0 评论 -
Java BIgIntger 计算大于long类型的整数操作
BigInteger b1 = new BigInteger("2020031920200319"); BigInteger b2 = new BigInteger("2020031820200318"); //加法 BigInteger add = b1.add(b2); System.out.println(add); //减法 BigInteger subtract = b1.subtra...原创 2020-03-20 09:20:09 · 301 阅读 · 0 评论