Java Interfaces

Create an interface called MyArrayInterface that contains method headers for the method signatures listed below. Then create a new class called ArrayCollection, that inherits the properties of the ArrayList class and implements your interface. Create a test driver that tests each new method to show that they work correctly.


-toString( ):String - creates and returns a string that correctly represents the current collection. Such a method could prove useful for testing and debugging the class and for testing and debugging applications that use the class. Assume each stored element already provides its own reasonable toString method.

-count(T target):int - returns a count of the number of elements e in the collection such that e.equals (target) is true.

-removeAll(T target):void - removes all elements e from the collection such that e.equals (target) is true.

-combine(ArrayCollection other):ArrayCollection - creates and returns a new ArrayCollection object that is a concatenated combination of this object and the argument object.

Need a custom answer at your budget?

This assignment has been answered 5 times in private sessions.

© 2024 Codify Tutor. All rights reserved