WRITE program that reads many (unknown number of) strings (one by one) from user input.If the input string is “bye” (all lower-case letters), then the program stops reading strings from user and starts processing (see below).You need to use ArrayList to receive user input strings.The “bye” input string will NOT be stored in the ArrayList you declared.
The processing procedure requirements and things you may need to consider are as follows:
1) During processing, your program needs to reverse the order of elements in the ArrayList.That means, if the original ArrayList is [“A1”, “B2”, “C3”, “D4”], then after processing, it will become [“D4”, “C3”, “B2”, “A1”].
2) If the ArrayList is empty or has only one string stored, then your program does nothing.
3) You may need to rely on a method listed on page 6 in the ArrayList slides to reverse things.
4) After processing, your program must print all elements, if there is any, in the ArrayList.