Question: I need some help please! It's a java inheritance. Create a class Person and Clerk derived from (a sub class of) Person . The Person
A Person Has A Telephone, Address, Name, Email
The Clerk class will have an equals() method. It must override the equals method of the parentclass(Person). The equals method in the Person class to override the equals method in the Object class. We considered the difference between using == and equals() method with String objects. Any class can, and should, define its own equals method. So, what does it mean that one clerk equals another clerk? We can define this such as two Clerk objects are equal, if they have the same salary and grade. So, clerk1.equals(clerk2) will return true if their salary and grade are "equal" by the definition. You might notice that when comparing String objects, you must use the equals method defined in the String class, as opposed to the relational == operator.
The equals method MUST accept an Object as its parameter.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
