Question: Demonstrate using code examples how you would use a List to represent the customers registered with an online store. You should sort the List in

Demonstrate using code examples how you would use a List to
represent the customers registered with an online store. You should sort
the List in such a way that the order of customers is based on the
lexicographic order (natural ordering of String) of their surname
followed by their first name.
Note: you can represent a customer by their surname, first name, and
email address only.
Illustrate the code for adding customers called Serena Williams and
Venus Williams to the List before sorting it.
What would the program output be if you print the List to the console?
Your code should include a toString() method in the Customer
class that returns a formatted string of the form:
Name: Williams, Serena
Email: swilliams@tennis.com

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!