You should read the API doc for the Scanner class. Go to this site and Find Scanner in the lower left column: Java Platform SE 6
Click on Scanner and its doc will come to the right hand section.