title: Printing all elements of an array.
body: <p>I have a simple piece of code, but there is one part that I cannot complete. 
  How do I print all the elements of an array after I have inputted them from the keyboard in a for loop,</p>
  
  <p>here is the code. 
  Thanks. </p>
  
  <pre><code>  final int MAX = 5;
    String [] names = new String[MAX];
  
    for(int index = 0; index &lt; MAX; index++){
       System.out.println("Enter a name: ");
       names[index]=keyboard.nextLine();
    }
    System.out.println(names);
  </code></pre>