注:以下资料都是我在网上搜刮来了。
背景
我本科做过几个android开发的项目,硕士阶段一直在用c++ ;
工作也想找C++的,奈何字节android hc多,就投了下。过了简历约了面试。最近就要好好复习了;
我现在java基本都快忘光了。
文章目录
1.单例模式
public class Singleton {
private static volatile Singleton singleton = null;
private Singleton(){
}
public static Singleton getSingleton(){
if(singleton == null){
synchronized (Singleton.class){
if(singleton == null){
singleton = new Singleton();