Java Object Equal equals(Object x, Object y)

Here you can find the source of equals(Object x, Object y)

Description

equals

License

Open Source License

Declaration

public static boolean equals(Object x, Object y) 

Method Source Code

//package com.java2s;
/*/*from   w ww  . jav  a 2s.co  m*/
 * ComparatorHelper.java   2005-7-17
 *
 * ??????: ???????(FTO)???? 2000-2005, ?????????.
 * ????????????(FTO)????????????????????????????????????????
 *
 * Copyright 2000-2005 FTO Software Team, Inc. All Rights Reserved.
 * This software is the proprietary information of FTO Software Team, Inc.
 * Use is subject to license terms.
 *
 * FTO???http://www.free-think.org
 */

import java.util.Arrays;

public class Main {

    public static boolean equals(Object x, Object y) {
        return x == y || (x != null && y != null && x.equals(y));
    }

    public static boolean equals(Object[] xs, Object[] ys) {
        return Arrays.equals(xs, ys);
        //      if(xs==ys){
        //         return true;
        //      }
        //      if(xs==null || ys==null){
        //         return false;
        //      }
        //      int xslen = xs.length;
        //      int yslen = ys.length;
        //      if(xslen != yslen){
        //         return false;
        //      }
        //      for(int i=0;i<xslen;i++){
        //         if(equals(xs[i], ys[i])==false){
        //            return false;
        //         }
        //      }
        //      return true;
    }
}

Related

  1. equals(Object o1, Object o2)
  2. equals(Object o1, Object o2)
  3. equals(Object object1, Object object2)
  4. equals(Object thisObj, Object thatObj)
  5. equals(Object v1, Object v2)
  6. equals(Object... objects)
  7. internalEquals(Object[] o1, Object[] o2)
  8. isEquals(final Object lhs, final Object rhs)
  9. isEquals(Object object1, Object object2)