Question: PLEASE WRITE THIS IN JAVA Write a method int getSequencelndex(ArrayList, String first, String second), Or, int getSequencelndex(String[], String first, String second) The method goes through
PLEASE WRITE THIS IN JAVA

Write a method int getSequencelndex(ArrayList, String first, String second), Or, int getSequencelndex(String[], String first, String second) The method goes through the ArrayList or array, trying to find the sequence of the two Strings in the argument: first, then second. If the Arraylist or array does not have enough Strings to search for the sequence of the two Strings, or the sequence can't be found, the method returns 1. Otherwise, it returns the starting index of the first occurrence of sequence. Separately, you will write some calling code: a code segment that populates an ArrayList or array with five Strings that are building names of NIU, such as "Faraday". Then calls the method you wrote by passing in the ArrayList or array, and a sequence of your choice (e.g. first can be "Faraday", second can be "Adams", and print out its return value
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
