Ask your own question, for FREE!
Computer Science 24 Online
OpenStudy (anonymous):

How can i break this loop once i receive all user input? while(in.hasNextDouble()) { if(valuesSize

OpenStudy (rsmith6559):

If the user enters nothing, the condition of the while statement should fail, hopefully not erroring.

OpenStudy (anonymous):

You can also use a sentinel value and have it evaluated with the in.hasNextDouble().

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!