Console Input error java.lang.NullPointerException
Are you running your program from an ide as console.readLine
returns null
when used from an IDE.
For more details refer to this
If you run it from command line you will not get this error.
System.console()
returns null if there is no console.
You can work round this either by adding a layer of indirection to your code or by running the code in an external console and attaching a remote debugger.
That is because, IDE is not using console !
Go to cmd.exe
type cd <bin path>
hit enter..
now type java <classname>
hit enter
It works!