Question: To be done in Java. Will definitely upvote, thanks! 1 //PART A 20 import java.util.List; 3 import java.util.ArrayList; 4 56 /* 6 * 7 This

To be done in Java. Will definitely upvote, thanks! To be done in Java. Will definitely upvote, thanks! 1 //PART A20 import java.util.List; 3 import java.util.ArrayList; 4 56 /* 6 * 7

1 //PART A 20 import java.util.List; 3 import java.util.ArrayList; 4 56 /* 6 * 7 This program loops through an array list of strings and finds the longest string 8 */ 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 18 // 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 326 public static void main(String[] args) 33 34 ArrayList elems = new ArrayList(); 35 String[] words = {"singapore", "cattle", "metropolitan", "turnstile", "city", "deviation"}; 36 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!