Question: Math 140 Programming Assignment2 Write a class called StringArrayList that is a modified version of the ArrayList class The StringArrayList class contains the following features

 Math 140 Programming Assignment2 Write a class called StringArrayList that is

Math 140 Programming Assignment2 Write a class called StringArrayList that is a modified version of the ArrayList class The StringArrayList class contains the following features Private Instance Variables Stringt] list - stores the String objects for the StringArrayList clas int size - contains the number of String objects added to the StringArrayList object. Note that 0 list.length then increase the length of the list array to minCapacity. Elements stored at positions 0 to size - 1 after changing the capacity should be identical to the values stored in these positions before increasing the array length. (Use techniques found in the increaseCapacity method presented in class.) Example: Suppose list "cat", "dog", "ABC); After calling ensureCapacity(5) the contents of list should be list ("cat", "dog", "ABC", null, null); Note that null values are automatically added to the array when increasing the capacity to five. IMPORTANT: ensureCapacity is the only method that can change the length of the list array

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!