Question: Create a Java class called StringArrayHelper that has the following attributes: StringArrayHelper myArray[] - String size - Integer StringArrayHelper () StringArrayHelper (String[]) addItem(String) - Boolean

Create a Java class called StringArrayHelper that has the following attributes:

StringArrayHelper
myArray[] - String
size - Integer
StringArrayHelper ()
StringArrayHelper (String[])
addItem(String) - Boolean
removeItem(String) - Boolean
searchItem(String) - Boolean
sortArray() - Boolean
getSize() - Integer
getCapacity() - Integer
toString() - String

Note:

addItem(String) will add an item to the list if it will fit. It will add the item to the first available spot

removeItem(String) will remove the given item and move all items that appear after the removed one in the list up one spot. Leaving all null values at the end of the list.

searchItem(String) will return true if that given string exists within the list and false if it does not.

sortArray() will use a selection sort to sort the list and return true if the list is sorted.

getSize() will return the total number of items that are currently in the array.

getCapacity() returns the total number of items that the array could possibly hold.

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!