Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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! image text in transcribedimage text in transcribed

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

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

Professional Visual Basic 6 Databases

Authors: Charles Williams

1st Edition

1861002025, 978-1861002020

More Books

Students also viewed these Databases questions