Java Set compare elements

Java Set compare elements

public  static  Boolean the equals (<?> <?> the Set setl, the Set SET2) {
         IF (setl == null || SET2 == null ) { // null than the direct 
            return  to false ; 
        } 
        IF (set1.size () ! = set2.size ()) { // different sizes than not also 
            return  to false ; 
        } 
     // sometimes we need to determine the list B is not a subset of the list a, we can use A.containsAll (B) is determined, when the return value is true when the B list to show that the list is a subset of a, when the return value is false when it indicates a subset B of the list is not a chain. 
        return set1.containsAll (SET2); // Finally ratio containsAll 
    }

Guess you like

Origin www.cnblogs.com/lizm166/p/12106961.html