0

Java

Is it possible in java for example to add int a; and then request it from the user?

9th Aug 2019, 7:22 AM
Михаил Попов
Михаил Попов - avatar
4 Respuestas
+ 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); }
9th Aug 2019, 9:11 PM
D_Stark
D_Stark - avatar
0
you can request int value and assign it to a
9th Aug 2019, 8:52 AM
zemiak
0
thanks, but can you give an example code?
9th Aug 2019, 8:54 AM
Михаил Попов
Михаил Попов - avatar
0
https://www.sololearn.com/learn/Java/2220/?ref=app (this you can open only in Sololearn app)
9th Aug 2019, 9:07 AM
zemiak