help differentiating user inputs

topic posted Fri, November 18, 2005 - 3:40 PM by  Unsubscribed
Share/Save/Bookmark
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
posted by:
Unsubscribed
Advertisement
Advertisement
  • Re: help differentiating user inputs

    Fri, November 18, 2005 - 4:33 PM
    if 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.

Recent topics in "Java Monkeys"

Topic Author Replies Last Post
Javascripting costs Schirin 3 May 17, 2007
Design patterns and principles emblylan 6 February 14, 2007
open source hosting alternatives? Mark 2 February 3, 2007
Ruby > Java Unsubscribed 6 January 9, 2007