title: How to create a empty set of array and fill it with user input and print it out?
body: <p>Here is my code to fill an empty array : </p>
  
  <pre><code>package duplicate.terminator;
  import java.util.Arrays;
  import java.util.Scanner;
  public class DuplicateTerminator {
         public static void main(String args []){
  
             Scanner number = new Scanner(System.in);
             int a, num;
             int[] integerset = null;
  
                  System.out.println("Enter Number: ");
                  num = number.nextInt();
                  Arrays.fill(integerset, num);
  
         }
  
  }
  </code></pre>
  
  <p>That is my code because I want to have this output.
  I need to stack input numbers in array and print it out like this.</p>
  
  <pre><code>Sample Input/Output:
      Enter number: 5
      5
      Enter number: 9
      5 9
      Enter number: 2
      5 9 2
      Enter number: 9
      9 has already been entered
      5 9 2
      Enter number: 1
      5 9 2 1
  </code></pre>