Please be gentle while answering, I am not a java developer (or developer in General)
While trying xml parsing with java I came across following -
NodeList nodelist = document.getElementsByTagName("item");
Herein xml dom object let me collect all objects depending on tag name I provide, but return type is an Interface called - nodelist. Since interface can not be instantiated it was a bit surprising for me.
Keeping break point and debugging the code I realized that I actually get object for class DeepNodeListImpl which implements NodeList interface.
How does this happen? How does java know to return object of "some implementation" held by my Interface "object" in the statement declared above.
One more thing - while reading the java api I found that IIOMetadataNode implements the NodeList but my previous code snippets does not get me object of type IIOMetadataNode