2017年9月16日 new Class()和getInstance()的区别
摘要:new class new关键字实际上是在heap(堆中)开辟了一块内存,而等号右边的这个对象实际上就是一个内存地址 getInstance() getInstance()主要是调用类中的static静态方法而获得的对象,属于单例对象,比如Calendar类的 区别: 1、getInstance()
阅读全文
posted @ 2017-09-16 22:47