As per definition toString()
returns "Returns a string representation of the object as:
getClass().getName() + '@' + Integer.toHexString(hashCode())
But sometimes I could see even if it is not Overriden in our class, it returns the String associated with it. I mean Object.toString()
returns some String but not "ClassName@HexCode
".
When does this happen. Please let me know whats the reason behind this ??
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…