Possible duplicate:
Why is the String.length () method?
If I want to know the length of the array, I will need to enter the following:
array.length
Therefore, this is a variable in which the length of the array with the name "array" is written.
In Strings, the same would look like this:
string.length()
Therefore, this is a method that returns the length of the variable 'string'.
But why did they decide to make these two different, while basically he does the same ... Is it because of efficiency or why else?
Thanks in advance.
source share