Greg Charles wrote:Hi Vin, welcome to Java Ranch! In the future, when you post code examples, please UseCodeTags (⇐click). They make code much easier to read. I've added them for you here.
I think the best way to handle your problem would be to use a try-catch. Have you studied about that yet?
Vin Ash wrote:no sorry didn't do that yet
Simply read the names of the methods for Scanner. You seem to want an int, so look for methods which supply an int. Remember you want hasNextXXX as well as nextXXX.
Vin Ash wrote:. . . Still figuring out how to input what campbell Ritchie wrote in my equations
sorry Greeg..first time in this forum so I will try to use code tags
Jason, going through the scanner glossary but so far no luck
Campbell Ritchie wrote:The appropriate hasNextXXX method does internally exactly what Winston suggests, so why write the code again?
Henry Wong wrote:Hint... Where in your latest version of code, do you read the input into your num variable?
Vin Ash wrote:I tried taking off brackets and so on...no difference
Vin Ash wrote:
but I never used input before
how can I put it here or give me another example on how it is used in another code