2015年12月26日
摘要: From the highly regardedElements of Java Styleto the pages ofJavaWorld(seeJava Tip 67), many well-meaning Java gurus encourage the use of the double-c... 阅读全文
posted @ 2015-12-26 16:18 gyt929458988 阅读(458) 评论(0) 推荐(0)
摘要: Java supports multiple threads to be executed. This may cause two or more threads to access the same fields or objects. Synchronization is a process w... 阅读全文
posted @ 2015-12-26 14:08 gyt929458988 阅读(2354) 评论(0) 推荐(0)
摘要: Depending on the usage, there are several "correct" answers.Since java5 the best way to do it is to use an enum:public enum Foo { INSTANCE;}The Righ... 阅读全文
posted @ 2015-12-26 08:39 gyt929458988 阅读(228) 评论(0) 推荐(0)