Question: Please write in JAva 1 Override the equals method, first defined in the Object class, for the classes contained in the UML class diagram below

Please write in JAva

Please write in JAva 1 Override the equals method, first defined in

1 Override the equals method, first defined in the Object class, for the classes contained in the UML class diagram below Requirements 1. Do not duplicate tests in any equals method 2. Methods must be efficient 3. Methods must not crash (i.e., throw exceptions) 4. Add constructors to initialize each object (do not place prompts or reads in the constructors) 5. Remove all "package" statements 6. You may include a main if you wish but I will use my own main for testing Options (Choose One) 1. Write all 4 classes in one file named Lock.java (Java only allows one public class in a file, so do not make the subclasses public; do not make any inner classes) 2. Write all 4 classes in separate files Equality is defined as follows 1. To be equal, both objects must be instances of the same class, additionally 2. Combination: both objects must have the same combination (ie., all fields must be equal) 3. Password: both objects must have the same password 4. Double: both objects must have the same password and the same pin Lock Password Combination password : String first: int second: int third int Double pin: int

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!