Question: Write a method called removeInRange that accepts three parameters, an ArrayList of strings, a beginning string, and an ending string, and removes from the list

Write a method called removeInRange that accepts three parameters, an ArrayList of strings, a beginning string, and an ending string, and removes from the list any strings that fall alphabetically between the start and end strings. For example, if the method is passed a list containing the elements ["to", "be", "or", "not", "to", "be", "that", "is", "the", "question"], "free" as the start String, and "rich" as the end String, the list’s elements should be changed to ["to", "be", "to", "be", "that", "the"]. The "or", "not", "is", and "question" should be removed because they occur alphabetically between "free" and "rich". You may assume that the start string alphabetically precedes the ending string.

Step by Step Solution

3.41 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

public static void removeInRang... View full answer

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 Building Java Programs A Back to Basics Approach Questions!