...
Note that the clone()
method must manually clone the Date
object. This step is sometimes unnecessary for primitive fields and fields which refer to immutable objects. If the current state of the object must be reflected in the clone, the default clone mechanism is unacceptable.
A mutable class that defines a clone()
method must be declared final
. This ensures that untrusted code cannot subclass and override the clone()
method to supply a spurious instance. The clone()
method should copy all internal mutable state as necessary. In this compliant solution, the Date
object is copied.
...