Answered step by step
Verified Expert Solution
Question
1 Approved Answer
needs to be done in java 1 Override the equals method, first defined in the Object class, for the classes contained in the UML class
needs to be done in java
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: intStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started