摘要: 1 package com.jdk7.chapter3; 2 3 import java.math.BigDecimal; 4 5 public class Round { 6 //调用java.util.Math进行四舍五入取整 7 public static long getRoundMath(double dou){ 8 return M... 阅读全文
posted @ 2018-01-16 22:16 celineluo 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 1 package com.jdk7.chapter3; 2 3 import java.text.DecimalFormat; 4 5 public class FormatNumber { 6 public static void main(String[] args) { 7 double data = 1203.405607809; 8 ... 阅读全文
posted @ 2018-01-16 21:36 celineluo 阅读(112) 评论(0) 推荐(0) 编辑
摘要: 基本数据类型与其封装类的对应关系如下: ♦字节(byte)的封装类是字节类(Byte)。 ♦短整型(short)的封装类是短整型类(Short)。 ♦整型(int)的封装类是整型类(Int)。 ♦长整型(long)的封装类是长整型类(Long)。 ♦单精度浮点型(float)的封装类是单精度浮点型类 阅读全文
posted @ 2018-01-16 20:53 celineluo 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 1 package com.jdk7.chapter2.adapter; 2 /** 3 * AdapterPrint适配器既继承了PrintIntArray的打印数组的功能,又实现了排序接口的排序功能SortNumber, 4 * 把不相关的功能集合到一起 5 * @author Administrator 6 * 7 */ 8 9 //需要使用不相关类的方法则继... 阅读全文
posted @ 2018-01-16 18:18 celineluo 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 其余类代码详见:http://www.cnblogs.com/celine/p/8290254.html 阅读全文
posted @ 2018-01-16 17:12 celineluo 阅读(88) 评论(0) 推荐(0) 编辑
摘要: 1 package com.jdk7.chapter2.singleton; 2 3 public class SingletonA { 4 //java虚拟机会加载静态变量 5 private static int id = 1; 6 private static SingletonA instance = new SingletonA(); 7 ... 阅读全文
posted @ 2018-01-16 16:21 celineluo 阅读(141) 评论(0) 推荐(0) 编辑