Question: Code a method called getLongest that takes an array of Strings and returns the longest String in the array before done is encountered -You can

Code a method called getLongest that takes an array of Strings and returns the longest String in the array before done is encountered

-You can assume a non-null array will be passed and that done element always be present

-Return the empty String for an array whose first element is done

-If there are multiple Strings with the same longest length return the LAST in the index order

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!