I'd recommend a google search of "java scanner" to get started.