Question: Complete the skeleton below for the method named longest that takes an array of Strings as input and returns the longest String in the array
Complete the skeleton below for the method named longest that takes an array of Strings as input and returns the longest String in the array to the calling program. For example, if the array has the values {"The", "Brown", "Fox"} then the method will return the value "Brown". In the case of ties your code can return ANY String with the longest length. For example if the array has the values {"The", "Quick", "Brown", "Fox"} you may return either "Brown" or "Quick". You may assume that the arrays passed to the method will have a length of at least 1.
private static String longest(String[] array) { // your code goes here
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
