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

javascript - IndexedDB error: Uncaught DataCloneError: Failed to execute 'put' on 'IDBObjectStore': An object could not be cloned -

amazon web services - When using Cognito credentials with AWS in a browser (javascript), keep getting "missing credentials" error -

c# - How to set the datatextfield value instead of the value on a drop down list? -