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
Post a Comment