...
While this code ensures that only one Helper
object is preserved prevented from being garbage collected, it allows multiple Helper
objects to be created. If constructing multiple Helper
objects is infeasible or expensive, this solution may be inappropriate unless a weak reference is used to hold Helper
.
...