0
how to give input value if input variable more than 2 someone please tell me
8 Respostas
+ 1
I beg your pardon? May you explain yourself?
+ 1
my name is kendy i live in indonesia i just want to enter university
+ 1
I did not ask that.
What did you mean by "if input variable more than 2"?
+ 1
oh
+ 1
The Scanner is not one value, it changes with each input.
To use it, first declare on it: Scanner scan = new Scanner (System.in);
Then, request a user for an input:
Syso ("Type in a number: ");
//Ask from Scanner to get the input as an Integer
int num1 = scan.nextInt (); //next Line () for String
Syso ("Type in a String: ");
String str = scan.NextLine (); //To declare a String as input and go to the next line
//Type scan.Next to just declare the String as input, without going to the next line
Syso ("Type in a rational number: ");
double num2 = scan.nextDouble ();
+ 1
Please mark my answer as best
0
like this
https://code.sololearn.com/c1fyVAOFyrsb/?ref=app
Scanner(System.in)more than 2 variable
0
ok thx for your help