Read user input using the Scanner class in Java

This simple example shows how to read user input with the Scanner class. The program below reads a percentage set by the user. The value must be between 0-100 and by using a loop the user can continue to input values until -1 is typed.

Search for more Java info on this site here:
Custom Search

Please type any questions here.