Question: Write a method will accept an array of Strings. This method should return the string that comes after all the other strings in lexicographical order.
Write a method will accept an array of Strings. This method should return the string that comes after all the other strings in lexicographical order. (Assume all the Strings only contain lower case letters. In Example: No number, no Capitals and no Symbols)
lastString({hola, word, night, boom}) word lastString({java, is, so, much, fun}) so lastString({i, love, java}) love
//precondition: words.length >0 public static String lastString(String[] words) {
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
