title: Is there a way to add multiple strings to a stack without using a push method each time
body: <p>I am working on a program to help student learn all the presidents in order. I am using a stack. I want to create a stack with all of the presidents in order. Then the user will enter a president name and the program will compare there input with the top of the stack.</p>
  
  <p>I want to know if there is a way to fill my stack with Strings without using the .push method 44 times?</p>
  
  <p>Here is what I have so far in my main:</p>
  
  <pre><code>package namepresidents;
  import java.util.Scanner;
  
  public class NamePresidents {
  
      public static void main(String[] args) 
      {
         BoundedStackInterface&lt;String&gt; presidents;
         presidents = new ArrayStack&lt;String&gt;(41);
  
         presidents.push("George Washington");
  
         String menu = "Would you like to study: \n"
                  + "1. All the presidents \n"
                  + "2. The first half \n"
                  + "3. The second half \n"
                  + "0. Exit \n";
  
          Scanner in = new Scanner(System.in);
  
          int option = in.nextInt();  
      }
  
  }
  </code></pre>
  
  <p>Here is my ArrayStack class for references:</p>
  
  <pre><code>package namepresidents;
  
  public class ArrayStack&lt;T&gt; implements BoundedStackInterface&lt;T&gt; {
      protected final int DEFCAP= 43;
      protected T[] stack;  //holds stack of elemets
      protected int topIndex = -1;
  
  
      public ArrayStack(){                        // default constructor
          stack = (T[]) new Object[DEFCAP];
      }
  
      public ArrayStack(int maxSize){             // constructor with user defined array size
          stack = (T[]) new Object[maxSize];
      }
  
  
      public void push(T element){
      //throws excption if the stack is full
      //otherwise places element on top of stack
          if (!isFull())
          {
              topIndex++;
              stack[topIndex] = element;
          }
          else
          {
              throw new StackOverflowException("Push attempted on a full stack.");
          }
      }
      public boolean isFull(){
             //returns true if the stack is full
          if (topIndex == stack.length-1)
          {
              return true;
          }
          else
          {
              return false;
          }
      }
  
      public boolean isEmpty(){
             //returns true if the stack is empty
          if (topIndex == -1)
          {
              return true;
          }
          else
          {
              return false;
          }
      }
      public void pop(){
      //throws excption if the stack is full
      //otherwise places element on top of stack
          if (!isEmpty())
          {
              stack[topIndex] = null;
              topIndex--;
          }
          else
          {
              throw new StackUnderflowException("Pop attempted on an empty stack.");
          }
      }
      public T top(){
      //throws excption if the stack is full
      //otherwise returns element on top of stack
          T topOfStack = null;
          if (!isEmpty())
          {
              topOfStack = stack[topIndex];
          }
          else
          {
              throw new StackUnderflowException("Top attempted on an empty stack.");
          }
          return topOfStack;
      }
  }
  </code></pre>