title: Array Length in Java
body: <p>I declared an array as shown below:</p>
  
  <pre><code>int[] arr = new int[10];
  </code></pre>
  
  <p>Then I assigned following values to the array:</p>
  
  <pre><code>arr[0] = 1;
  arr[1] = 2;
  arr[2] = 3;
  arr[3] = 4;
  </code></pre>
  
  <p>Then I declared and initialized an integer variable:</p>
  
  <pre><code>int arrayLength = arr.length;
  </code></pre>
  
  <p>This will be useful to find actual size but is there any method to find logical size of the array?</p>