Here you can find the source of objectsEqual(T a, T b)
Parameter | Description |
---|---|
obj1 | a parameter |
obj2 | a parameter |
public static <T> boolean objectsEqual(T a, T b)
//package com.java2s; //License from project: Apache License public class Main { /**/*from www . j ava2s . com*/ * Compares if two objects are equal, handling the cases where one of both of them may be null * @param obj1 * @param obj2 * @return */ public static <T> boolean objectsEqual(T a, T b) { return (a == b) || (a != null && a.equals(b)); } }