Here you can find the source of identityToString(Object obj)
Parameter | Description |
---|---|
obj | the object (may be <code>null</code>) |
null
public static String identityToString(Object obj)
//package com.java2s; public class Main { private static final String EMPTY_STRING = ""; /**//from w w w .j ava 2 s .c om * Return a String representation of an object's overall identity. * @param obj the object (may be <code>null</code>) * @return the object's identity as String representation, * or an empty String if the object was <code>null</code> */ public static String identityToString(Object obj) { if (obj == null) { return EMPTY_STRING; } return obj.getClass().getName() + "@" + getIdentityHexString(obj); } /** * Return a hex String form of an object's identity hash code. * @param obj the object * @return the object's identity code in hex notation */ public static String getIdentityHexString(Object obj) { return Integer.toHexString(System.identityHashCode(obj)); } }