How to accept input from keyboard

If you need to write interactive text-based application in Java, you will need a way to accept input from the keyboard; sure you can get it from the command line, but at some point, you will need to prompt the user for an input and store that input somewhere in your code for later processing. [...]