Here you can find the source of objectsEqual(Object obj1, Object obj2)
public static boolean objectsEqual(Object obj1, Object obj2)
//package com.java2s; /**// w w w.ja v a2 s .co m * Copyright (c) 2003,2004 International Business Machines Corporation. * All Rights Reserved. * * This software is provided and licensed under the terms and conditions * of the Common Public License: * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html */ public class Main { public static boolean objectsEqual(Object obj1, Object obj2) { if (obj1 == null) { return (obj2 == null); } else { return obj1.equals(obj2); } } }