StringLengthField
DRAFT

Misconception:

String objects have a length field that contains the length of the string.

Incorrect

One can know the length of a String object by accessing its length field

Correct

One can know the length of a String object by calling its length method

Origin
Where could this misconception come from?

If students know about arrays, they might reason using an inappropriate analogy and thus believe that objects of class String have a length field (since arrays indeed have a final instance variable named length).

Stay up-to-date

Follow us on  twitter to hear about new misconceptions.