0
Java
Is it possible in java for example to add int a; and then request it from the user?
4 Answers
+ 3
In sololearn you have to write a comment in your code to tell the user what to enter but if int a is your variable and you want to store a int value to it from scanner heres the code.
import java.util.Scanner;
//main{
int a = new Scanner(System.in).nextInt();
System.out.print(a);
}
0
you can request int value and assign it to a
0
thanks, but can you give an example code?
0
https://www.sololearn.com/learn/Java/2220/?ref=app
(this you can open only in Sololearn app)