Advertisement
i am a novice programmer and do not have too much expertise in strings. I was attempting a low-level program assignment and ran into a problem.
i am asking the user for input of an 'int', however, if the user inputs a different value, such as a char or a double, i would like to output an error message, then reprompt the user for input
if anyone could let me know what the general code necessary to complete this task, as well as any necessary import statements, i would appreciate your help greatly
i am asking the user for input of an 'int', however, if the user inputs a different value, such as a char or a double, i would like to output an error message, then reprompt the user for input
if anyone could let me know what the general code necessary to complete this task, as well as any necessary import statements, i would appreciate your help greatly
posted by:
|
|
Unsubscribed |
Advertisement
Advertisement
-
Re: help differentiating user inputs
Fri, November 18, 2005 - 4:33 PMif you don't have access to a book like _Java In A Nutshell_ or _Java Cookbook_ (though that's kind of overkill for this), one or two Google searches should help you.
in general, folks in forums of all kinds respond poorly to "please do my homework for me" sorts of requests--we probably have our own work to do and aren't very excited about doing someone else's as well. for my part, it being a cheery Friday afternoon, I invite you to examine the java.lang.Integer class.
