title: What is inside code for array.length() in Java?
body: <p>What is stored in 10th location of array
  say</p>
  
  <pre><code>int[] array=new int[10];
  </code></pre>
  
  <p>Say we have values stored from <code>array[0]</code> to <code>array[9]</code>, if I were to print elements without using</p>
  
  <pre><code>array.length()
  </code></pre>
  
  <p>or <code>for (int a: array)</code></p>
  
  <p>How do I proceed?</p>
  
  <p>My basic question is how will JVM determine end of array, is it when a null is encountered parsing array or when a garbage value is encountered? what is inbuilt code of <code>array.length()</code> function?</p>