Question: Supply a class Person that implements the Comparable interface. Compare persons by their names. Ask the user to input ten names and generate ten Person
Supply a class Person that implements the Comparable interface. Compare persons by their names. Ask the user to input ten names and generate ten Person objects. Using the compareTo method, determine the first and last person among them and print them.
Step by Step Solution
3.32 Rating (149 Votes )
There are 3 Steps involved in it
public class Person implements Comparable private String name public PersonS... View full answer
Get step-by-step solutions from verified subject matter experts
