面试

一个问题是android广播什么时候使用??

说实话还真没注意过,看了http://www.cnblogs.com/lwbqqyumidi/p/4168017.html  ,还是没有太理解.... 有没有大神留言告诉一下 ,谢谢了。

 

2,java同步

才知道synchronized 是同步的意思....以前都一直以为是“锁”呢........

3,单列(多线程下)

以为私有构造+静态get方法就可以了........

package zhaodp.demo;

public class Singleton {
  private static Singleton uniqueInstance = null;

  public static Singleton instance() {
    if (uniqueInstance == null) {
      synchronized (Singleton.class) {
        if (uniqueInstance == null)
          uniqueInstance = new Singleton();
        }
      }
    return uniqueInstance;
  }
}

 

http://blog.csdn.net/mrfly/article/details/13372441

posted @ 2015-12-10 15:45  杰世  阅读(112)  评论(0)    收藏  举报