Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions