Question: Java Create a class called ArrayToArrayList. It should have a private variable which is a string array. It should have an instance method that uses

Java

Create a class called ArrayToArrayList. It should have a private variable which is a string array. It should have an instance method that uses a loop to add strings from an array to an arraylist and then return the arraylist.

In a TestArrayToArrayList class you should use the method you created earlier to produce a random array of strings. This new method called randomStrings must be adjusted to produce strings of random length, for example 10 strings of lengths ranging from 4 letters to 10 letters. Make 4 objects of the ArrayToArrayList class and use them to test the ArrayToArrayList class. Print the arraylists.

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!