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 programs output might look like the following:
Type a name: Taylor Smith
Type a name: Marie Singer
Marie Singer goes before Taylor Smith
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
