Question: 5 . 2 5 LAB: Longest string ( EO ) Write a method, findLongest 0 , that takes two strings as parameters and returns the
LAB: Longest string EO
Write a method, findLongest that takes two strings as parameters and returns the longest string. If the strings are the same length then return the second string.
Ex If the input is:
almond pistachio
the method findLongest returns and then the program outputs:
pistachio
Your program must define the following method:
public String findLongestString str String str
qxy
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
