Use the compareTo method to write code that reads two names from the console and prints the

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 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

Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question
Question Posted: