title: Java, need help creating a method to select a specific element in an array
body: <p>I have several commands created to ask a user to add numbers to an array.  I now need to be able to have the user select a specific element in the array and place an * on the selected element when printed out.  I have the program separated into two classes: one class for storing and managing the array and the other handles user input and output.  </p>
  
  <p>For example here is the code in the class that handles input/output:</p>
  
  <pre><code>else if (cmd.equals("add"))
          {
              // add x command
              int x = input.nextInt();
              list.add(x);
              list.print();
          }
  </code></pre>
  
  <p>and here is the part in the class that deals with the array:</p>
  
  <pre><code>public void add(int x)
  {
      // Expand the list capacity if necessary
      if (count &gt;= list.length)
      {
          // Allocate a new longer list
          int[] newList = new int[list.length + 5];
  
          // Copy existing numbers to new list
          for (int i = 0; i &lt; list.length; i++)
          {
              newList[i] = list[i];
          }
  
          // Reassign the list to be the new one
          list = newList;
      }
  
      // Add x to the end of the list
      list[count] = x;
      count++;
  }
  </code></pre>
  
  <p>This is the command created to add entries to the array(and enlarge the array if necessary), now I just need help creating a command to allow a user to select a specific entry in the array and place an * in front of it.</p>