0
There is an easyer way
import java........ than write public static Scanner "insert name here" = new Scanner(System.in); after that you can just use this like this: int a = "insert name here".nextInt(); example import java.util.Scanner; public class a{ public static Scanner reader = new Scanner(System.in); public static void main(String[]args){ int x = reader.nextInt(); System.out.println(x); } } it should work but it doesnt any ideas why? it works on my computer...
3 Antworten
+ 2
Yes it works on code playground...
The only difference is the limitation of input/output, so you need to enter all values needed by your script together juste before start ^^
0
?
0
in java(eclipse)
you can get user input like i showed in the example above
it is not working in this program
why is that?