02 2017 档案

摘要://懒汉模式public class Singleton { private static Singleton instance; /** * 私有化构造方法 */ private Singleton(){ } public static Singleton getInstance(){ if (instance... 阅读全文
posted @ 2017-02-14 08:32 Fly_Coding 阅读(138) 评论(0) 推荐(0) 编辑
摘要:Map map = new HashMap(); String[] string = {"abc","123","234","345","234","234","234","345","345","345","345","234","234"}; for(String s:string){ Integer count = m... 阅读全文
posted @ 2017-02-10 14:34 Fly_Coding 阅读(1878) 评论(0) 推荐(0) 编辑
摘要:上述代码输出结果为4 上述代码输出结果也为4 阅读全文
posted @ 2017-02-10 14:24 Fly_Coding 阅读(89) 评论(0) 推荐(0) 编辑
摘要:import java.util.HashMap; import java.util.Iterator; import java.util.Map; public class TestMap { public static void main(String[] args) { Map map = new HashMap(); map.put(1, "a"... 阅读全文
posted @ 2017-02-10 10:24 Fly_Coding 阅读(164) 评论(0) 推荐(0) 编辑
摘要:在foreach循环里做元素的remove/add操作时,例如 会抛出异常java.util.ConcurrentModificationException (以ArrayList来讲解)在ArrayList中,它的修改操作(add/remove)都会对modCount这个字段+1,modCount 阅读全文
posted @ 2017-02-10 10:06 Fly_Coding 阅读(234) 评论(0) 推荐(0) 编辑
摘要:上面的代码输出结果为 0.0600000000000000050.5800000000000001401.499999999999941.2329999999999999 原因在于我们的计算机是二进制的。浮点数没有办法是用二进制进行精确表示。我们的CPU表示浮点数由两个部分组成:指数和尾数,这样的表 阅读全文
posted @ 2017-02-05 14:28 Fly_Coding 阅读(2305) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示