title: Getting variable name while make a new object
body: <p>I'm creating an instance from object <code>Node</code> for instance. My question is that how can I have a function inside my class that returns the object name for me. For instance, something like this:</p>
  
  <pre><code>class Node (val in: Int) {
    def getName() = ...
  }
  </code></pre>
  
  <p>And then:</p>
  
  <pre><code>val testNode1 = new Node(5)
  val testNode2 = new Node(4)
  
  testNode1.getName()    //Print: "testNode1"
  testNode2.getName()    //Print: "testNode2"
  </code></pre>