摘要:
BigDecimal类可以用来更精确的求出小数之间的加减乘除,取除数和余数。 方法一: BigDecimal bd1 = new BigDecimal("1.5"); 构造方法中传入字符串,才能精确计算,开发中推荐 BigDecimal bd2 = new BigDecimal("3.0"); Sy 阅读全文
摘要:
BigInteger的概述:可以让超过Integer 范围内的数据进行运算。 构造方法: public BIGInteger (String val); 通过构造方法接收String类型的数字 String s = "123456789987654321123"; BigInteger b = ne 阅读全文
摘要:
long start = System.currentTimeMillis(); 程序开始执行的时间点 单位:毫秒 for(int i =0;i<1000;i++) { System.out.println("*"); } long end = System.currentTimeMillis(); 阅读全文
摘要:
Random r = new Random(); for (int i = 0; i < 10; i++) { System.out.println(r.nextInt(100));//1-100之间生成随机数 } 阅读全文