title: Creating an array with user input
body: <p>I'm trying to create a code that lets the user determine the size and elements of an array and then print it out. So far I have this.</p>
  
  <pre><code>import java.util.Scanner; 
  
  public class test3 {
  
    public static void main (String[] args)
    { 
      Scanner keyboard=new Scanner(System.in);
      System.out.println("Input how many numbers you want to find the median for (numerical value) :");
      int num = keyboard.nextInt();
      System.out.println("Please enter " + num + " numbers.");
      int[] values = new int[num];
      for (int i = 0; i &lt; num; i++) {
          values[i] = keyboard.nextInt();
          System.out.println(values[i]);
  
  
      }
    }
  }
  </code></pre>
  
  <p>I don't know if it is right because when a user inputs the size and then the elements, the code is just displaying the element as the user inputs it. For example,</p>
  
  <p>input how many numbers you want to find the median for </p>
  
  <p>5</p>
  
  <p>please enter 5 numbers</p>
  
  <p>3//user input</p>
  
  <p>3//what is displayed. </p>
  
  <p>I want to make it so that the user inputs all of their numbers and THEN it displays the inputed numbers as an array.</p>
  
  <p>We are not allowed to use the array class by the way. </p>