ArrayListProgramming. Write a methodremoveShorterStrings that takes an ArrayList of strings as aparameter and that removes from each successive pair of values theshorter string in the pair. For example, suppose that an ArrayListcalled “list” contains the following values:
[“four”, “score”, “and”, “seven”, “years”, “ago”]
In the first pair of strings (“four” and “score”) the shorterstring is “four”. In the second pair of strings (“and” and “seven”)the shorter String is “and”. In the third pair of strings (“years”and “ago”) the shorter string is “ago”. Therefore, the call:
removeShorterStrings(list);
should remove these shorter strings, leaving the list with thefollowing sequence of values after the method finishesexecuting:
[“score”, “seven”,
PayPal Gateway not configured
PayPal Gateway not configured