In this Java program you will implement your own doubly linkedlists.
Implement the following operations that Java7 LinkedLists have.
1. public DList()
This creates the empty list
2. public void addFirst(String element)
adds the element to the front of the list
3. public void addLast(String element)
adds the element to the end of the list
4. public String getFirst()
5. public String getLast()
6. public String removeLast()
removes & returns the last element of the list.
7. public String removeFirst()
removes & returns the front element of the list.
8. public String get(int index)
Returns the value at “position” index. IndexOutOfBoundsExceptionshould be
thrown if the index is non-existent.
9. public String set(int index, String value)
changes the value at “position” index and returns the old value.IndexOutOfBoundsException should be thrown if the index isnon-existent.
10. public int indexOf(Object obj)
Returns the index of obj if it is in the list and -1 otherwise.
11. public int size()
12.public boolean contains(Object obj)
Returns true if obj appears in the list and false otherwise.
13. public Iterator iterator()
Returns an iterator over the list. This should be a non staticinner class.