+ 1
How to solve isEqules using Arraylist class in java !?
Instance method isEqual that accepts a parameter aSet of type Set. The method will return true, if aSet is equal to âthis objectâ, else it will return false. Two sets are equal, if they contain the same elements in any order. Ex: Let A and B be two sets; A = {7, 4, 20, 15, 12}, B = {4, 7, 12, 15, 20}. As sets A and B contain same elements, but in different order, therefore, they are equal.
1 Answer
0
They may be equal if they contain the same values as you mentioned, but you would have to sort the unsorted set first, and them you may compare.