title: How do you get the "object reference" of an object in java when toString() and hashCode() have been overridden?
body: <p>I would like to print the "object reference" of an object in Java for debugging purposes.
  I.e. to make sure that the object is the same (or different) depending on the situation.</p>
  
  <p>The problem is that the class in question inherits from another class, which has overriden both toString() and hashCode() which would usually give me the id.</p>
  
  <p>Example situation:
  Running a multi-threaded application, where I (during development) want to check if all the threads use the same instance of a resource object or not.</p>