+ 1
Can I have a program with more than one user input?
If not, is there a way I can separate two variables in a user input
4 Answers
+ 6
Asking for Sololearn's Code Playground?
You just separate two inputs by a line-break.. First input in first line and second in second.
+ 2
Thank you Nikhil
And then how do I transfer them separately into doubles?
- 1
Depending on how you read the inputs, you could put them on 1 line or hundreds. If you're using Scanner, each input is separated by whitespace so:
1 2 3
and
1
2
3
are identical to your code.
- 1
Scanner nextDouble() method reads one double and returns it's value to be assigned as needed.