...
Mutable classes that define a clone()
method must be declared final
. This ensures that untrusted code cannot declare a subclass that overrides the clone()
method to create a spurious instance. The clone()
method should copy all internal mutable state as necessary — �€” in this compliant example, the Date
object.
...