If I try your code by copy'n'paste into an online compiler (
Online Java Compiler[
^]) it does exactly what I expected: asks for an input, and prints the number I typed.
So ... I suspect it's how you are compiling and running your code, rather than a problem with it. Start by looking closely at exactly what your are doing to build your app, and then at how you re running it.
Sorry, but we can't do any of that for you!