Question: With Strings, we need to use the equals method to determine if two Strings are the same. Lets write an equals method for the ArrayList
With Strings, we need to use the equals method to determine if two Strings are the same.
Lets write an equals method for the ArrayList class that returns true if two ArrayLists are the same, and false if the ArrayLists are not identical. An ArrayList is identical if all of the values at each index are the same.
import java.util.ArrayList; public class isEqual { public static void main(String[] args) { //This code is just to test your equals method ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
