Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help implementing this method. All the methods that are in the interface are already implemented. Need help with the last one in both classes

Need help implementing this method. All the methods that are in the interface are already implemented. Need help with the last one in both classes ArrayList and LinkedList image text in transcribed
image text in transcribed
image text in transcribed
2. Consider a member method replaceAll() for the List ADT that replaces all the instances of an elemente with element f. The method returns the total number of instances replaced. The prototype for the method is as follows: public int replaceAll (E e, Ef) And this method to the interface and implement it for the ArrayList and LinkedList classes. dow Help ArrayList.java List.java * 1 package ciic4020.list; 3 public interface List extends Iterable { INNEGURE covouwn public void add(E obj); public void add(int index, E obj); public boolean remove(E obj); public boolean remove(int index); public int removeAll(E obj); public E get(int index); public E set(int index, E obj); public E first(); public Elast(); public int first Index(E obj); public int lastIndex(E obj); public int size(); public boolean isEmpty(); public boolean contains (E obj); public void clear(); public int replaceAll (E e, E f); 2020 203 @Override public int replaceAll(E e, E f) { 204 return 0; 205 206 207 } }

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

=+how might their legitimacy be improved?

Answered: 1 week ago