0
How can I get separately two strings from a Scanner ?
When the user enter an input in the Scanner, how can I get the input separately to obtain two strings separately ?
5 Answers
+ 4
You can ask the user to enter the values in one line but separated by comma, and then you can fix an array as follows:
String[ ] input : input.nextLine( ).split(",");
I assume you'll understand what split method does.
+ 5
How to input:
split multiple inputs into seperate lines
how to get multiple inputs:
declare multiple scanners each of an input
+ 3
You're welcome! âș
+ 2
Ok... You helped me ! Thanks
0
But I don't understand... How can I split in two strings, just one Scanner ?