Question: Write ( define ) a public static method named longest, that takes two arguments ( all arguments will be Strings ) . When this method
Write define a public static method named longest, that takes two arguments all arguments will be Strings When this method is called, it should determine which string is longer, and return that string. If both arguments are the same length, then this method should return the first argument string.
Examples:
longestabcab will return "abc"
longesthello "goodbye" will return "goodbye"
longestthursday will return "thursday"
You may wish to write some additional code to test your method.
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
