hahaha yes I realised that by default It's int,using byte for that means putting myself in trouble. Sometimes I think about weird thingsPaweł Baczyński wrote:
All things are lawful, but not all things are profitable.
All things are lawful, but not all things are profitable.
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?
All things are lawful, but not all things are profitable.
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?
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |