Question: Instructions Write a method max that has two string parameters and returns the larger of the two. Submit HNMASONOGGHE 1 public static String max(String

Instructions Write a method max that has two string parameters and returns the larger of the two. Submit HNMASONOGGHE 1 public static String max(String a,String b){ if(a.compareTo(b) > 0) 2 4 5 6 7 8 9 10 11 12 } { } return a; if(a.compareTo(b) < 0) return b; } else ( return max; )
Step by Step Solution
There are 3 Steps involved in it
Answer JAVA METHOD public static String maxString aString b ifalengthblength return a else ... View full answer
Get step-by-step solutions from verified subject matter experts
