title: Java Class isntance(with ToString method overriding) outputs "adt.BinaryNode@1e24e45"
body: <p>Hello i have overriden <code>toString()</code> method in my own class, but somehow the output is not exactly the one I wanted. Sorry for the newbie question but i cant figure out where the problem is, any  hint / help is mostly appreciated. Thank you.</p>
  
  <p>Myclass:</p>
  
  <pre><code>public class Country implements Comparable&lt;Country&gt;{
      private String name;
      private String capital;
      private int area;
  
      public Country(String a, String b, int c) {
          this.name = a;
          this.capital = b;
          this.area =c;
      }
  
      @Override
      public String toString(){
          return(this.name + " "+ this.capital+" " + this.area);
      }
  }
  </code></pre>
  
  <p>DS:</p>
  
  <pre><code>private void  preorder(BinaryNode  &lt;type&gt;  a){
        if (a != null){
         System.out.println(a.toString());
         preorder(a.left);
         preorder(a.right );
        }
  } 
  </code></pre>
  
  <p>App:</p>
  
  <pre><code>BinarySearchTree &lt;Country&gt; db = new BinarySearchTree&lt;Country&gt;();
      Country ob  = new Country("Romania", "Buc", 123);
      db.addNewElement(ob);
          ob  = new Country("Hungaria", "Bud", 50);
      db.addNewElement(ob);
          ob  = new Country("Vatican", "Vat", 1);
      db.addNewElement(ob);
      db.printAll();
  </code></pre>
  
  <p>output:</p>
  
  <pre><code>adt.BinaryNode@1e5e2c3
  adt.BinaryNode@18a992f
  adt.BinaryNode@4f1d0d
  </code></pre>
  
  <p>EDIT: fix after "chaitanya10" hint  for msitake</p>
  
  <p>DS:</p>
  
  <pre><code>private void  preorder(BinaryNode  &lt;type&gt;  a){
        if (a != null){
         System.out.println(a.elm.toString()); // ACCES the data in node not the hole node.
         preorder(a.left);
         preorder(a.right );
        }
  } 
  </code></pre>