Steffe Wilson wrote:Is there any rationale to these apparent inconsistencies that will help me to remember when to use length, length() or size()? Or do I just have to remember which to use on a case-by-case basis?
Steffe Wilson wrote:Roel - what you say about arrays having a public & final attribute called length is a great way for me to remember. Is this unique to the array type in the Java core language?
Steffe Wilson wrote:Am I ok to think in terms of special case for Arrays (length attribute) and Strings (length() method) whereas all the Collections use size() ? Or will I encounter more special cases? Eg are there special cases amongst the Collections?
nick woodward wrote:Obviously this isn't reasoning, just a method for remembering.