In other words, instead of using the Scanner's next() method (which will get a string value), use the nextInt() method to get an int value.