effective_java_2nd_endition文摘

CHAPTER 2  Creating and Destroying Objects

Item1: Consider static factory methods instread of constructors

1.static factory methods hava names

2.they are not required to create a new object each time they're invoked

3.they can return an object of any subtype of their return type

原文地址:https://www.cnblogs.com/smileberry/p/2769780.html