Possible Duplicate:
Why is String.length() a method?
If I want to know the length of an array I will have to type the following:
array.length
Therefore, it is a variable in which is written the length of the array called 'array'.
On Strings the same thing will look like this:
string.length()
Therefore, it's a method that returns the length of the 'string' variable.
But why did they choose to make those two different, while it basically does the same thing... Is this because of efficiency or why else?
Thank you in advance.