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...

1st Feb 2017, 8:59 PM
elad
elad - avatar
3 Answers
+ 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 ^^
2nd Feb 2017, 12:18 AM
visph
visph - avatar
0
?
1st Feb 2017, 9:00 PM
DerpyOmnister
DerpyOmnister - avatar
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?
1st Feb 2017, 9:01 PM
elad
elad - avatar