CS 1063, Fall 2005
Java Input Without 1.5

In case your version of JBuilder is using the 1.5 version of Java, you can use the following code to input an integer:

If you don't have version 1.5 on your computer, or if you can't seem to configure JBuilder to work with 1.5, you can use the following approaches, which work with older versions of Java. In the following, the blue code above has been replaced with red below. It's a little more complicated, but you just have to copy the "magic" commands.

In case you want to read numbers somewhere besides the main method, you would need to have the phrase throws IOException on every method from main down to where you are doing the input. This can be annoying, so instead you can use the following code anywhere, even buried inside a private method. As before, the blue code at the beginning has been replaced with red below.