Depends how you are starting the program. If you start it from the terminal withjava HW..., then there will be a Console, but it you start it with JWS or javaw, which you get if you run it as part of an executable .jar or from an IDE there won't be a Console and any attempt to use the Console will suffer such an exception. That is why I have forgotten that Console even exists.
Zulfi Khan wrote:. . . . This means that NetBeans 8.2 is not suitable for this program. Is there any way I can run run it on NetBeans 8.2? . . .
Haven't you answered your own question? As Tim M says, it should run nicely at the command line/terminal.
Stop using Console. I have tried Console, but soon found its behaviour too unpredictable; it is too likely to be null and cause problems like what you are seeing. Use a Scanner reading from System.in, or better still, write a utility class to read from System.in. System,in is usually represented on IDEs (at least I think it is).