getting data in the object form when reading the xml file
<p>Following code is written to fetch the data from the <code>xml</code> file. I think it does fetch but in the object form. Why is that ?</p>

<pre><code>package newpackage;

import java.io.File;
import java.util.Iterator;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import java.util.LinkedList;

public class xmlParser {


private DocumentBuilder db;
private DocumentBuilderFactory dbf;
private Document dom;
private LinkedList list = new LinkedList();

public static void main(String args[]) {
    xmlParser o = new xmlParser();
    o.parseXML();
    o.parseDocument();
    o.print();
}

public void parseXML() { // getting a document builder
    try {
        dbf = DocumentBuilderFactory.newInstance();
        db = dbf.newDocumentBuilder();
        dom = db.parse(new File("Details.xml"));
    } catch(Exception exc) {
        exc.printStackTrace();
    }
}

public void parseDocument() { // get a list of student elements
    Element docEle = dom.getDocumentElement();
    NodeList nl = docEle.getElementsByTagName("Details");
    if(nl != null &amp;&amp; nl.getLength() &gt; 0) {
        for(int i=0;i&lt;nl.getLength();i++) {
            Element el = (Element)nl.item(i);
           Details details = new Details();
           details = details.getDetail(el);
           list.add(details);
        }
    }
}

public void print() {
 //        list.iterator();
 //        while(!list.isEmpty()) {
 //            System.out.println(list.pop().toString());
 //        }

      Iterator it = list.iterator();
      while(it.hasNext()) {
          System.out.println(it.next().toString());
      }

  }    
}
</code></pre>

<p><em>Output :</em></p>

<pre><code>newpackage.Details@1ac3c08
newpackage.Details@9971ad
newpackage.Details@1f630dc
newpackage.Details@1c5c1
</code></pre>

<p>Why do i get the output in the object form even after applying <code>toString</code> ?</p>
