title: Create an ArrayList only containing Strings. Print using enhanced for loop
body: <p>So here is my program: </p>
  
  <p>Create an ArrayList that will only contain strings
  Add the following to the list in order</p>
  
  <ul>
  <li>Mary</li>
  <li>John</li>
  <li>Mahendra</li>
  <li>Sara</li>
  <li>Jose</li>
  <li>Judy</li>
  </ul>
  
  <p>Print the list using the enhanced for loop
  Insert Harry in front of Mahendra and after John
  Then Remove position 4 from the list</p>
  
  <p>Here's what I've written:</p>
  
  <pre><code>import java.util.ArrayList;
  import java.util.Scanner;
  
  public class Name {
      public static void main(String[] args) {
          ArrayList&lt;String&gt; names = new ArrayList&lt;String&gt;();
          Scanner input = new Scanner(System.in);
          names.add(input.nextLine());
          names.add(input.nextLine());
          names.add(input.nextLine());
          names.add(input.nextLine());
          names.add(input.nextLine());
          names.add(input.nextLine());
          names.add(input.nextLine());
  
          for (String n : names) {
          System.out.println(n);
          }
      }
  }
  </code></pre>
  
  <p>I guess I'm having problems with adding and removing. I believe everything else should be fine though.</p>