摘要: 单例模式:why?创建对象的时间、内存消耗、GC及停顿时间恶汉式:(缺点是实例创建没法延迟加载)publicclassSingleton{privateSingleton(){}privatestaticSingletoninstance=newSingleton();publicstaticSingletongetInstance(){returninstance;}}懒汉式:(缺点:多线程下性能问题)publicclassLazySingleton{privateLazySingleton(){}privatestaticLazySingletoninstance=null;publics 阅读全文
posted @ 2014-04-12 19:41 慕 名 阅读(183) 评论(0) 推荐(0)
摘要: WHY IS A BYTE 8 BITS? OR IS IT?Computer History Vignettes By Bob BemerI recently received an e-mail from one Zeno Luiz Iensen Nadal, a worker for Siemens in Brazil. He asked "My Algorythms teacher asked me and my colleagues 'Why a byte has eight bits?' Is there a technical answer for th 阅读全文
posted @ 2014-04-12 19:07 慕 名 阅读(189) 评论(0) 推荐(0)