This is what I changed it to and it worked:
do
{
if(done != null)
list.add(Integer.parseInt(done));
if(scan.hasNextInt() || scan.hasNext("done"))
done = scan.nextLine();
else
Type: Posts; User: that_guy
This is what I changed it to and it worked:
do
{
if(done != null)
list.add(Integer.parseInt(done));
if(scan.hasNextInt() || scan.hasNext("done"))
done = scan.nextLine();
else
I am trying to determine if the user did not input a correct value without throwing an exception.
I have a String variable, done, which stores the user input and then if it is not storing "done"...