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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started