+ 3

How to get multiple input at time in java ?

26th Jun 2019, 1:49 PM
Programmer Raja
Programmer Raja - avatar
4 Antworten
+ 3
do you mean this? Scanner sc = new Scanner(System.in); String in1 = sc.next(); String in2 = sc.next();
26th Jun 2019, 2:06 PM
Anton Böhler
Anton Böhler - avatar
+ 2
Anton Böhler i need like this scanf("%d %s ,&num,&str); I need to give input int and string in single line in output
26th Jun 2019, 3:42 PM
Programmer Raja
Programmer Raja - avatar
+ 2
It's impossible
26th Jun 2019, 6:03 PM
Kirill Smirnov
Kirill Smirnov - avatar
+ 2
import java.util.Scanner; ... var s = System.out; s.println("Input String int :"); Scanner in = new Scanner(System.in); Scanner line = new Scanner(in.nextLine() ); s.println(line.next() ); s.println(line.nextInt() );
26th Jun 2019, 11:23 PM
zemiak