摘要: 1.闲话少说,直接上代码。 import java.io.Serializable;//饿汉式public class Singleton01 implements Serializable{ //1.私有的属性 private static Singleton01 instance=new Sin 阅读全文
posted @ 2016-07-04 20:29 modelfrog 阅读(811) 评论(0) 推荐(0)
摘要: 在java1.7之前大家都清楚switch的比较范围只能局限于(int 、short 、byte 、char)之间,Java 虚拟机和字节代码这个层次上,只支持在 switch 语句中使用与整数类型兼容的类型。在1.7后switch实现字符串比较的功能。具体是如何做到的?实际上,Java虚拟机和字节 阅读全文
posted @ 2016-07-04 19:53 modelfrog 阅读(32393) 评论(0) 推荐(1)