Here you can find the source of areEqual(Object obj1, Object obj2)
Parameter | Description |
---|---|
obj1 | object reference |
obj2 | object reference |
public static boolean areEqual(Object obj1, Object obj2)
//package com.java2s; //License from project: Apache License public class Main { /**/*from w w w. j a va 2 s.c om*/ * Tests whether two object references refer to equal objects. The object * references can both be null, in which case they are also considered equal. * @param obj1 object reference * @param obj2 object reference * @return true if both references are null, OR if neither is null and both * objects are equal; false otherwise */ public static boolean areEqual(Object obj1, Object obj2) { if (obj1 == obj2) { return true; } else if (obj1 == null || obj2 == null) { return false; } else { return obj1.equals(obj2); } } }