Question: IN JAVA 8 18 //PART A 2 import java.util.List; import java.util.ArrayList; 56 /* * 7 * This program Loops through an array list of strings

IN JAVA

IN JAVA 8 18 //PART A 2 import java.util.List; import java.util.ArrayList; 56

8 18 //PART A 2 import java.util.List; import java.util.ArrayList; 56 /* * 7 * This program Loops through an array list of strings and finds the longest string */ 9 public class Find Longest 10 110 /* 12 * Given the array list of strings, return the longest string 13 */ 140 public static String findLongest(ArrayList list) 15 16 -Start below here. To do: approximate lines of code = 8 17 // loop through the list of strings and check to see if // the string length is > the current longest string. If so, update the 19 // longest string length. Be sure to create a variable to hold the longest string itself 20 // as well as the length 21 22 23 24 25 26 27 28 29 -End here. Please do not remove this comment. Reminder: no changes outside the todo regions. 30 } 31 320 public static void main(String[] args) ArrayList elems = new ArrayList(); 35 String[] words = {"singapore", "cattle", "metropolitan", "turnstile", "city", "deviation"); for (int i = 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!