Here you can find the source of areEqual(final Object o1, final Object o2)
Parameter | Description |
---|---|
o1 | to test equality of |
o2 | to test equality of |
public static boolean areEqual(final Object o1, final Object o2)
//package com.java2s; /* See LICENSE for licensing and NOTICE for copyright. */ public class Main { /**// w w w . ja v a 2 s .c o m * Determines equality of the supplied objects by delegating to their hashCode methods. * * @param o1 to test equality of * @param o2 to test equality of * * @return whether o1 equals o2 */ public static boolean areEqual(final Object o1, final Object o2) { if (o1 == null) { return o2 == null; } return o2 != null && (o1 == o2 || o1.getClass() == o2.getClass() && o1.hashCode() == o2.hashCode()); } }