We are studying how to parse through the DOM tree in Java. Quick question, in the below partial code my prof gave us, he creates an ArrayList and adds the Document object to it. I've only used the ArrayList to add items to the list like String, int, etc. In this case, when he adds the Document object to it, does Java automatically put each Node into the list?
DocumentBuilder docBuilder =
DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = docBuilder.parse(f);
List<Node> nodeList = new ArrayList<Node>();
nodeList.add(doc);
while(nodeList.size() > 0)
Thanks!