Here you can find the source of areEquals(final Object o1, final Object o2)
equals()
methods.
Parameter | Description |
---|---|
o1 | one object |
o2 | another object |
true
if they're both null
or both equal
public static boolean areEquals(final Object o1, final Object o2)
//package com.java2s; public class Main { /**//from ww w.j ava2 s.co m * Utility method for <code>equals()</code> methods. * * @param o1 one object * @param o2 another object * * @return <code>true</code> if they're both <code>null</code> or both equal */ public static boolean areEquals(final Object o1, final Object o2) { return (o1 == o2) || (o1 != null && o1.equals(o2)); } }