In Java please
For this assignment, you will write a program for storing the names and phone numbers of the user's contacts. Create the following classes:
1. Contact: two String fields for the contact's name and the contact's phone number. Store the phone number as a String as opposed to an integer to allow for special characters such as parentheses and dashes.
2. ContactList: an updated version of the LinkedList class from last week's lecture. One field: firstNode, a reference to the head Node of an internal linked list. ContactList should also have a private inner class named Node with two fields: a reference to a Contact and a reference to the next Node in the list.
3. Main: for testing your ContactList class.
Implement the following methods in ContactList:
1. add(String name, String newNumber). Adds a new Contact object to ContactList's internal linked list. This will be a little different from the version in LinkedList, because we want the Contacts to remain sorted in alphabetical order. When a Contact is added, find its correct location in the list and place it there. Do not worry about sorting by last name, just by overall name i.e., "Ryan Adams" should go after "Jill Smith". If you are unsure how to determine whether one String comes before another in Java, read "Note 2" at the bottom of this prompt.
2. Override toString so that it returns a nicely formatted String with each Contact name and phone number.
3. remove(String name). Remove the Contact with the given name from the list.
4. changePhoneNumber(String name, String newNumber). Update the phone number of the contact with the given name.
On Main.java, thoroughly test ContactList. Make sure to test as many corner cases as possible (i.e., does it work when you remove the first Contact? How about the last Contact? etc.)
Note: You are not required to perform a sort on the list!
When you add a new Contact, the method only needs to find the correct location for that particular object.
For example, if the user adds 'Bob' to an empty ContactList, it becomes the first (and only) Contact.
If the user then adds 'Adam', it becomes the new head of the list (since it comes before 'Bob' alphabetically).
Finally, if the user adds Barb, the list should be Adam ->Barb ->Bob.
The trick is that each call to the add method only adds a single Contact to a list which is already in order.
Note 2: To determine if one String is greater than or less than another String, you can use String's compareTo method. If you are not familiar with how compareTo works, read here Links to an external site. for more information. If you still have questions on this, please let me know and I'll help you out!