¥Each execution of the expression
new Empty()
creates a new object. In principle, there is only one empty list, just like there is only one number
0. Hence, we would like to represent the empty list by a single library.
¥The singleton pattern is the
mechanism that we use to create a unique
instance of a class. This pattern consists of two chunks of code:
Ða static final field in
the class that holds the single instance of the
class
Ða private attribute on
the class constructor, so no client can create
another instance of the class.
¥