Question
in Java, Redefine the class Person so that, in addition to what the existing class does, you can: i. Set the last name only. ii.
in Java,
Redefine the class Person so that, in addition to what the existing class does, you can: i. Set the last name only.
ii. Set the first name only.
iii. Set the middle name.
iv. Check whether a given last name is the same as the last name of this person.
v. Check whether a given first name is the same as the first name of this person.
vi. Check whether a given middle name is the same as the middle name of this person.
b. Add the method equals that returns true if two objects contain the same first, middle, and last name.
c. Add the method makeCopy that copies the instance variables of a Person object into another Person object.
d. Add the method getCopy that creates and returns the address of the object, which is a copy of another Person object.
e. Add the copy constructor.
f. Write the definitions of the methods of the class Person to implement the operations for this class.
g. Write a program that tests various operations of the class Person.
Step 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