a. Write a Java method called longestWord that takes one argument which is a 1D arr of String of name words and return the longest string which has maximum number characters. The header is: public static String longestWord (String[] words) b. In the main method, define an array of String named arrl with 10 items. read from the user the 10 words and store them in the array arrl. call the method longestWord to determine the longest word and then print

icon
Related questions
Question
100%

Q_1

a. Write a Java method called longestWord that takes one argument which is a 1D arr
of String of name words and return the longest string which has maximum number
characters. The header is:
public static String longestWord (String[] words)
b. In the main method,
• define an array of String named arrl with 10 items.
read from the user the 10 words and store them in the array arr1.
call the method longestWord to determine the longest word and then print
Transcribed Image Text:a. Write a Java method called longestWord that takes one argument which is a 1D arr of String of name words and return the longest string which has maximum number characters. The header is: public static String longestWord (String[] words) b. In the main method, • define an array of String named arrl with 10 items. read from the user the 10 words and store them in the array arr1. call the method longestWord to determine the longest word and then print
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer