title: How do you put multiple inputs on one line?
body: <p>This is probably a easy question for most of you but the answer has evaded me for the most part. I'm writing a program to sort three numbers from lowest to highest and in the command prompt the inputs must be all on one line. I have the program working but for whatever reason I cannot get the inputs to show on one line. Instead I get something like:</p>
  
  <pre><code>Please enter three numbers: 1
  
  2
  
  3
  
  Sorted numbers are: 1, 2, 3
  </code></pre>
  
  <p>Where it should show</p>
  
  <pre><code>Please enter three numbers: 1 2 3
  
  Sorted numbers are: 1, 2, 3
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>import java.util.Scanner;
  public class Ch5PA1
  {
  public static void main(String[] args) {
  // Declarations
  Scanner input = new Scanner(System.in);
  
  System.out.print("Enter three values: ");
  double num1 = input.nextDouble();
  double num2 = input.nextDouble();
  double num3 = input.nextDouble();
  displaySortedNumbers(num1, num2, num3);
  }
  
  /** Sort Numbers */
  public static void displaySortedNumbers(double num1, double num2, double num3){
  double highest = num1 &gt; num2 &amp;&amp; num1 &gt; num3 ? num1 : num2 &gt; num1 &amp;&amp; num2 &gt; num3 ? num2 : num3;
  double lowest = num1 &lt; num2 &amp;&amp; num1 &lt; num3 ? num1 : num2 &lt; num1 &amp;&amp; num2 &lt; num3 ? num2 : num3;
  double middle = num1 != highest &amp;&amp; num1 != lowest ? num1 : num2 != highest &amp;&amp; num2 != lowest ? num2 : num3;
  System.out.println("The sorted numbers are " + lowest + " " + middle + " " + highest);
  }
  }
  </code></pre>