Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Implement the following public methods in your implementation of the List interface,called ExpressLinkedList: 1 . boolean add ( E e ) 2 . void add

Implement the following public methods in your implementation of the List interface,called ExpressLinkedList:1. boolean add(E e)2. void add(int index, E element)3. E remove(int index)4. E get(int index)5. int size()6. void clear()7. String toString()(see Java API: AbstractCollection2)One public constructor should exist in your implementation: one that takes no parametersand creates an empty list when the class is instantiated.The class should use generics. The behaviour of the methods in your implementationshould be equivalent to that of Java Standard Librarys classes (e.g., LinkedList; pleaserefer to the class API online). For the methods of the interface that you do not need toimplement, you may either leave them empty or throw an exceptionpublic type someUnneededMethod(){throw new UnsupportedOperationException();}Of course, you are free to implement any private or protected methods and classes as yousee fit. However, the methods mentioned above (or the ones present in the List interface,or in the class superclasses) are the only public methods your class should contain (e.g.,there should be no main method). Furthermore, your code should not have any sideeffects, such as printing to the console in case you relied on that during debugging.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago