斗爷

导航

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

posted on 2012-11-14 13:38  斗哥哥  阅读(153)  评论(0编辑  收藏  举报