Welcome to the Ranch
You can’t use parseInt because that requires a
String which represents an
int. If you want to use a blank line as a sentinel, you can use its length() method, or there is a new (Java6+) method in the String class called isEmpty(). If the length is 0 or the String is empty, then you have a blank line. You can use the trim() method on a line which starts or ends with whitespace, to shorten it.