+ 3
How to get multiple input at time in java ?
4 Antworten
+ 3
do you mean this?
Scanner sc = new Scanner(System.in);
String in1 = sc.next();
String in2 = sc.next();
+ 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
+ 2
It's impossible
+ 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() );