Question: In java programming language, i have attached two files (Program3.java and MyClass.java) also a screenshot of sample execution. Any help is appreciated thanks!! The extra

In java programming language, i have attached two files (Program3.java and MyClass.java) also a screenshot of sample execution. Any help is appreciated thanks!! The extra pictures are the same code but show the bottom part
 In java programming language, i have attached two files (Program3.java and
MyClass.java) also a screenshot of sample execution. Any help is appreciated thanks!!
The extra pictures are the same code but show the bottom part
HOMEWORK GOAL This is an individual homework grade. The assignment is to
add a clone operation and a copy constructor to a class that
has mutable instance variables in it. PROGRAM REQUIREMENTS I have posted a

HOMEWORK GOAL This is an individual homework grade. The assignment is to add a clone operation and a copy constructor to a class that has mutable instance variables in it. PROGRAM REQUIREMENTS I have posted a small program (Program3.java and MyClass.java) along with this assignment file on canvas, in the Assignments Directory. Add clone and a copy constructor to MyClass.java (don't forget to put your name in the comments). Add code to Program 3 to test your operations and make sure you are getting independent object data after the copies happen. ADDITIONAL INFORMATION TO TURN IN Turn in your versions of Program3.java and MyClass.java to canvas by the due date. Also, use this exercise to think about using gets/sets with classes like this What could happen to the state of an object if you were provide a get that simply returns a reference to the numbers instance variable? How would you handle it if you were using data types in your class that also contain internal mutable data? How do you ensure that those instances are handled properly. What if I wanted to pass in mutable objects into set methods? When Is it okay? When do I need to make a copy? What information should I put in my documentation for the users of my class

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!