You could use one of the Scanner class's methods to read the input into a variable.
Look at the API doc for the Scanner class and/or do a Search here on the forum for sample code.

If that is not...