Question: Write Java code for extending the ArrayList class of java.util.* to ExtArraayList that includes the following one method: public boolean equals(ExtArrayList eal) // returns true

Write Java code for extending the ArrayList class of java.util.* to ExtArraayList that includes the following one method: public boolean equals(ExtArrayList eal) // returns true if the values in this list is the same as in eal. For instance, if E is Integer and this has {2,1,3,1,6} and eal has {1,2,3,1,6} then you should return true. If eal has {1,2,3,6}, you should return false. Clearly the size of each should be the same but obviously there is more to it than that. You can assume the existence of equals() method for testing equality of E. Do not use specific types like String or Integer. Estimate the run-time complexity of the methods assuming the size of the list is n.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To solve this problem we will extend the ArrayList class to create a custom class ExtArrayList ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!