0
How can i get multiple input in java?
5 odpowiedzi
+ 4
I guess you have troubles with sololearn input.
You have to enter all values at the beginning.
for example you want to integer.
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int b = scan.nextInt();
Now you have to enter the values in this form: 3 2
If you use nextLine():
String s1 = scan.nextLine();
String s2 = scan.nextLine();
Here you have to enter in this form:
"hello" [enter]
"test"
+ 1
Using loops to repeat input and ArrayList to store an array of variable length
You can also try the split() method
+ 1
Can you be specific more about your question..?
If you are asking about SL compiler, then you need to give all required inputs at ones only by space separated or in line by line..
+ 1
Thank you so much ,i got it now
+ 1
Elaaouam Mohamed Your welcome :)