Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]java question
- To: tlug <tlug@example.com>
- Subject: java question
- From: B0Ti <9915104t@example.com>
- Date: Thu, 14 Jun 2001 00:19:47 +0900
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- Organization: Kobe University, Japan
- Reply-To: tlug@example.com
- Resent-From: tlug@example.com
- Resent-Message-ID: <dE-MuD.A.FhG.lQ4J7@example.com>
- Resent-Sender: tlug-request@example.com
- Sender: boti
Evening, Maybe it's trivial, but I cannot find a clean solution to this. I need to read in an integer and it must be within a limit. Something like this: try { int someInt = Integer.parseInt(readUserInput()); if (someInt > 10 || someInt < 0) throw new NumberFormatException; } catch (NumberFormatException) { /* goto begin :( ...*/ } My problem is that when NumberFormatException is caught I need to go back (restart at try) and read in the integer again. Having grown up on basic I would immediately use a goto statement if java would allow it. How should this be done cleanly and effectively? -- B0Ti.
- Follow-Ups:
- Re: java question
- From: "Thomas O'Dowd" <tom@example.com>
- Re: java question
- From: Fredric Fredricson <fredric.fredriksson@example.com>
- java question
- From: "Stephen J. Turnbull" <turnbull@example.com>
Home | Main Index | Thread Index
- Prev by Date: Re: HELP !!
- Next by Date: Re: java question
- Prev by thread: Re: HELP !!
- Next by thread: Re: java question
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links