Question: Method name: lowestAlphabetically Parameter(s): A String of lower-case words separated by spaces and made up of the letters a-z. The String will have at least
Method name: lowestAlphabetically Parameter(s): A String of lower-case words separated by spaces and made up of the letters a-z. The String will have at least one word. Return value: A String containing the lowest alphabetical word. The String method compareTo() does a lexicographic comparison between two strings, which allows you to test for the lowest alphabetical word. Read documentation on compareTo() in order to understand how to use it. Example: lowestAlphabetically("cat dog apple fish") would return "apple".
Please do not use arrays, only scanners and the language is Java.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
