String objects have a
length field that contains the length of the string.
One can know the length of a String object by accessing its length field
One can know the length of a String object by calling its length method
OriginWhere 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