collections - Java - How to see the definition of size() method in List interface? -


in below code, how size() method gets value? definition or control flow?

as list interface, should not contain definition of size() method. in below code able use size() method interface without implementing it.

 list<webelement> linkelements = driver.findelements(by.tagname("a"));  string[] linktexts = new string[linkelements.size()]; 

the size() method implemented (directly or indirectly) class implements list interface. list<webelement> variable holds reference instance of class implements list<webelement>, , therefore contains implementation of size() method.


Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -