DEVRY ECET 370 Entire Course DEVRY ECET 370 Week 2 Lab 2 | Page 2

this function to determine the size of the list ( accessor function ). d . void clear (): create this function to remove all of the items from the list . After this operation , the length of the list is zero . e . void replace ( int location , int item ): create this function to replace the item in the list at the position specified by location . The item should be replaced with item . f . void insert ( int location , int item ): create this function to add an item to the list at the position specified by location . g . void remove ( int item ): create this function to delete an item from the list . All occurrences of item in the list should be removed . h . int get ( int location ): create a function that returns the element at location . i . public ArrayList copy (): create a function that makes a deep copy to another ArrayList object .
Exercise 3 : Using an array-based list Using the class ArrayList completed in the previous exercise , write a program that uses it to store 100 random numbers . Consider that each of these random numbers is an integer in the interval [ 0 , 200 ]. Write the program in such a way that there are no number duplicates .
Exercise 4 : Review of the library class java . util . ArrayList Create a project using the classes in the DocSharing area labeled “ Using java . util . ArrayList ." Compile it , run it , and review the code that is given carefully . This code is the complete program given in our lecture that tests the library class java . util . ArrayList .
Exercise 5 : Using the library class java . util . ArrayList Rewrite Exercise 3 ( above ) using the class java . util . ArrayList to store the 100 random numbers .