黑马程序员技术交流社区

标题: Class Factory Methods [打印本页]

作者: hbpiaoyi    时间: 2016-10-19 06:46
标题: Class Factory Methods
1. The client receiving this object does not own the object and thus (per the object-ownership policy) is not responsible for releasing it.
2. They can not only combine allocation and initialization, but the allocation can inform the initialization.
3. Although an init... method could verify that only one instance exists at any one time in a program, it would require the prior allocation of a “raw” instance and then, in memory-managed code, would have to release that instance.





欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2