Question: JAVA PLZ Consider the following class definition: public class Large List { private int[] pos; public void reset(int[] new Pos) { this.pos = new Pos;

JAVA PLZ
Consider the following class definition: public class Large List { private int[] pos; public void reset(int[] new Pos) { this.pos = new Pos; } 1- Create a public constructor that takes one integer named 'number'. Initialize pos to a new integer array of length 'number'. Initialize the contents of the pos array to random integers. Each integer entry should be greater than the previous entry by a small random amount (+1...+10). All array values should be positive. 2- Create a public copy constructor that takes a reference to another Large List object. Perform a deep copy i.e. the new object will use its own position array. 3- Write a public method named equals which returns true only when two LargeLists objects are identical. Write a main method to test the class. Create two Largelist objects. Use the constructor that takes one integer parameter to create the first Large List object. Set the size of the pos array to 3 elements. For the second Large List pos array, set the size of the pos array elements to 4. Check if the two pos arrays are equal. Create a copy of the first Large List object using the copy constructor. Check if the two objects are equal. Reset the values of the pos array elements in the copy object to 4, 6 and 7. Check if the copy object is still equal to the original copied LargeList object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
