Question: Use the compareTo method to write code that reads two names from the console and prints the one that comes first in alphabetical order. For
Use the compareTo method to write code that reads two names from the console and prints the one that comes first in alphabetical order. For example, the program’s output might look like the following:
Type a name: Tyler Durden
Type a name: Marla Singer
Marla Singer goes before Tyler Durden
Step by Step Solution
3.47 Rating (147 Votes )
There are 3 Steps involved in it
Code that reads two names from the console and prints the one that comes first in alphabetical ... View full answer
Get step-by-step solutions from verified subject matter experts
