hahaha yes I realised that by default It's int,using byte for that means putting myself in trouble. Sometimes I think about weird things
Paweł Baczyński wrote:
Fred Kleinschmidt wrote:
Bod MacNeil wrote:I thought my while loop would run at least once as sc.hasNextInt() should return false as nothing is passed to it?
Would a do while loop be better? I tried that also and it didn't work.
does that mean I have to stop the user from entering any negative numbers?
That form of loop looks incorrect to me, and I think it will not work.
Bod MacNeil wrote:. . .
If you follow my suggestion of creating a utility class, you can overload the netxInt method to return only values in a particular range. I showed you part of that method
Ivan Jozsef Balazs - does that mean I have to stop the user from entering any negative numbers?