0
Java user input
How can I add more than one user input variable in Java? For example: import java.util.Scanner class MyClass { public static void main(String[ ] args) { Scanner h = new Scanner(System.in) System.out.println(h.nextLine()); } } How can I add another user input variable?
2 Answers
+ 2
Hello Zach Janzen
You can do it when you assign each user input to a variable.
String str = h.nextLine();
int num = h.nextInt();
... and so on.
0
This really helps me alot.