In Java why is length a method for Strings, while it is a variable for Arrays?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/8720220/why-is-string-length-a-method">Why is String.length() a method?</a>  </p>
</blockquote>



<p>If I want to know the length of an array I will have to type the following:</p>

<pre><code>array.length
</code></pre>

<p>Therefore, it is a variable in which is written the length of the array called 'array'.</p>

<p>On Strings the same thing will look like this:</p>

<pre><code>string.length()
</code></pre>

<p>Therefore, it's a method that returns the length of the 'string' variable.</p>

<p>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?</p>

<p>Thank you in advance.</p>
