1 Contact Task 15pts Public Class Contact Implements Comparable Class Maintains Informatio Q37282832

1. Contact Task:

(15pts) public class Contact implementsComparable<Contact> : This class maintains information for asingle contact, namely the following 3 instance variables aredefined: name, phone and email, all of type String.  Notethat this class will be used when defining an entry type for thehash map used in the PhoneBook class.  Furthermore, thisclass implements Comparable which makes instances of this class tobe comparable against others.  This is useful when weneed to call any of the generic methods in the Collection frameworkwhich requires a type that is comparable, such as the static methodCollections.sort defined in the Collections utilityclass.  Additionally, this class will provide thefollowing public methods:

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.