title: how can i get an object name when it is created in java?
body: <p>when an object is created how can i get the name of that object ??</p>
  
  <p>for example let's consider a class Book:</p>
  
  <pre><code>public class Book {
    private String name;
    private int pages;
  
    public Book(String name, int pages) {
          this.name = name;
          this.pages = pages;
    }
  
    }
  // now i create an object of this class
  Book book = new Book("Java",100);
  </code></pre>
  
  <p>i want to get the name of the object created that is "book", is there any way to get it  ?
  i tried the toString(), function and it does not work it prints something like this: @3d4eac69</p>