Question: Need some help with this assignment. Java Use the following classes, SimpleArray (synchronized version), ArrayWrite, and SharedArrayTest for this program. Change the array size to
Need some help with this assignment. Java
Use the following classes, SimpleArray (synchronized version), ArrayWrite, and SharedArrayTest for this program. Change the array size to 15,000,000. Modified the run method to add random numbers (between 1-20) to the array. Add a totalArray attribute to the SimpleArray class to return the sum of the members in the array. Use four threads and make sure you do not populate the array past the end of it. Remove all the Thread.sleep statements in the methods of the classes mentioned above. Create a simple integer array of size 15,000,000, populate it with random numbers (between 1-20), and return the sum of the members. Use the Date/Time API timing techniques described in Section 23.12 to compare the time required for both programs to run
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
