Wiki Markup |
---|
Composition may be used to create a new class that encapsulates an existing class, but then adds a value or field, the value of which must be equal for objects of this new class to be equal. If objects of this new class are equated with objects of the encapsulated class, the new class must defineoverride anthe {{Object.equals()}} method, and this method must follow the general contract for {{equals()}} as specified by the Java Language Specification \[[JLS 2005|AA. Bibliography#JLS 05]\]. |
...