java基础_单例模式
摘要:java开发实战经典 --单例模式 从CSDN以及博客园的相关文章学习的,摘做笔记。 “java中单例模式是一种常见的设计模式,单例模式的写法有好几种,这里主要介绍三种:懒汉式单例、饿汉式单例、登记式单例。 单例模式有以下特点: 1、单例类只能有一个实例。 2、单例类必须自己创建自己的唯一实例。 3
阅读全文
posted @
2016-03-03 13:46
Linatao
阅读(196)
推荐(0) 编辑
基础_String
摘要:String str1="hello"; String str2="hello"; String str3="hello"; String str4=new String("hello"); String str5=str4; System.out.println(str1==str2); //true System.out.p...
阅读全文
posted @
2016-03-02 13:28
Linatao
阅读(177)
推荐(0) 编辑