title: How to display the value of an array by the index number?
body: <p>The user enters 10 numbers. After that, the program asks the user to enter the index number they want to retrieve like the example below.</p>
  <p><a href="https://i.stack.imgur.com/MnuPB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MnuPB.png" alt="enter image description here" /></a></p>
  <p>How do I ask the user to input an index number and print the array in that specific index number?</p>
  <p>This is my code so far</p>
  <pre><code>
  public class ArrayElement {
  
      public static void main(String[] args) {
          int [] Array = new int[10];
          int index;
  
          Scanner input = new Scanner(System.in);
  
          System.out.println(&quot;Enter 10 elements:&quot;);
  
          for (int i = 0; i&lt;10; i++){
              Array[i] = input.nextInt();
  
          }
  
          System.out.print(&quot;Enter an index you want to retrieve: &quot;);
          index = input.nextInt();
  
      }
  }
  </code></pre>