neha. bajaj wrote:Hello,
ArrayList class has size() and get() methods, so to do invoke these methods on an ArrayList object is fine but how this is going on an List interface reference ?
because, ArrayList implements List and List declare get,size methods.
I assume you are also wondering how List changes are reflected in to backed array?
from asList javadoc:
Returns a fixed-size list backed by the specified array. (Changes to
* the returned list "write through" to the array.)