Skip to content

Files

Latest commit

 

History

History
20 lines (13 loc) · 404 Bytes

CloneWithoutCloneable.md

File metadata and controls

20 lines (13 loc) · 404 Bytes

Pattern: clone() without Cloneable

Issue: -

Description

The method clone() should only be declared if the class implements the Cloneable interface.

Example of violations:

class ValueClass {
    ValueClass clone() {
    }
}

Further Reading