Effective Java By Joshua Bloch: Item1 - Static Factory Method

后端 未结 6 615
猫巷女王i
猫巷女王i 2020-12-13 05:20

I am reading the Effective Java by Joshua Bloch and I have question about Item1 Static Factory Method.

Quote[Bloch, p.7]<

6条回答
  •  一生所求
    2020-12-13 06:00

    So take for example Collections.unmodifiableList(...). It returns some implementation of List. But the implementation class's name is irrelevant. Furthermore, said class is only constructed through the static factory method.

提交回复
热议问题