Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.help > #1054

Re: How would you do this kind of validatioin checking

Path csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.news-service.com!feeder.news-service.com!aioe.org!.POSTED!not-for-mail
From Roedy Green <see_website@mindprod.com.invalid>
Newsgroups comp.lang.java.help
Subject Re: How would you do this kind of validatioin checking
Date Mon, 12 Sep 2011 21:59:42 -0700
Organization Canadian Mind Products
Lines 17
Message-ID <4oot67hso1eer84d8ahpl9u1vtk160ajvr@4ax.com> (permalink)
References <mp9t6719gf0b4hhjjmk9od1j5g97e7ndoe@4ax.com>
Reply-To Roedy Green <see_website@mindprod.com.invalid>
NNTP-Posting-Host RCd/Ul4tyxGUBII8WGwa5g.user.speranza.aioe.org
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
Content-Transfer-Encoding 7bit
X-Complaints-To abuse@aioe.org
X-Notice Filtered by postfilter v. 0.8.2
X-Newsreader Forte Agent 6.00/32.1186
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.help:1054

Show key headers only | View raw


On Mon, 12 Sep 2011 20:12:59 -0500, "Thee Chicago Wolf (MVP)" <.@.>
wrote, quoted or indirectly quoted someone who said :

>
>If I wanted to do validation checking to counter someone purposely
>entering character input where Int is being expected,

nextInt could be constructed to raise an exception.

You could read strings, then do Integer.parseInt which does raise an
exception that you can catch and produce an error message.
-- 
Roedy Green Canadian Mind Products
http://mindprod.com
The modern conservative is engaged in one of man's oldest exercises in moral philosophy; that is, 
the search for a superior moral justification for selfishness.
~ John Kenneth Galbraith (born: 1908-10-15 died: 2006-04-29 at age: 97) 

Back to comp.lang.java.help | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

How would you do this kind of validatioin checking "Thee Chicago Wolf (MVP)" <.@.> - 2011-09-12 20:12 -0500
  Re: How would you do this kind of validatioin checking Knute Johnson <nospam@knutejohnson.com> - 2011-09-12 18:44 -0700
  Re: How would you do this kind of validatioin checking Eric Sosman <esosman@ieee-dot-org.invalid> - 2011-09-12 21:58 -0400
    Re: How would you do this kind of validatioin checking "Thee Chicago Wolf [MVP]" <.@.> - 2011-09-13 08:41 -0500
  Re: How would you do this kind of validatioin checking Roedy Green <see_website@mindprod.com.invalid> - 2011-09-12 21:59 -0700
    Re: How would you do this kind of validatioin checking "Thee Chicago Wolf [MVP]" <.@.> - 2011-09-13 08:44 -0500
      Re: How would you do this kind of validatioin checking Roedy Green <see_website@mindprod.com.invalid> - 2011-09-13 12:27 -0700

csiph-web