fork(3) download
  1. import java.util.*;
  2. import java.lang.*;
  3.  
  4. class Main
  5. {
  6. public static void main (String[] args) throws java.lang.Exception
  7. {
  8. Scanner scanner = new Scanner("1 2 3 foo bar");
  9. int value1 = scanner.nextInt();
  10. int value2 = scanner.nextInt();
  11. int value3 = scanner.nextInt();
  12. scanner.skip(" ");
  13. String text = scanner.nextLine();
  14. System.out.println("Values: " + value1 + ", " + value2 + ", " + value3 + ", " + text);
  15. }
  16. }
Success #stdin #stdout 0.1s 212864KB
stdin
Standard input is empty
stdout
Values: 1, 2, 3, foo bar