title: Java: Collecting input with multiple variable types on a single line
body: <p>How do I collect 4 variables of different types (string, float and integer) of input on a single line like this: (string, float, float, int)?</p>
  
  <p>For example:</p>
  
  <pre><code>"joey" 17.4 39.9 6
  </code></pre>
  
  <p>This is what my code looks like now. It works but it only collects the variables one line at a time.</p>
  
  <pre><code>import java.util.Scanner;
  
  public class EmployeePay{
  
      public static void main(String[] args) {
  
      Scanner keyboard = new Scanner(System.in);
      String employeeID = "";
      double hrsWorked;
      double wageRate;
      int deductions;
  
      System.out.println("Hello Employee! Please input your employee ID, hours worked per week, hourly rate, and deductions: ");
      employeeID = keyboard.nextLine();
      hrsWorked = keyboard.nextFloat();
      wageRate = keyboard.nextFloat();
      deductions = keyboard.nextInt();
      }
  }
  </code></pre>
  
  <p>Do I need to use a <code>for</code> loop?</p>