Answered step by step
Verified Expert Solution
Link Copied!

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 javaimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

LOQ 4-17 How do gender roles and gender identity differ?

Answered: 1 week ago

Question

I receive useful feedback about my performance.

Answered: 1 week ago

Question

I am encouraged to offer opinions/suggestions.

Answered: 1 week ago