Scanner substitution in 1.4



Hello,

I'm new to java. It has been only two weeks since I had my first cup.
I use the java.util.Scanner class in my 1.5 app's to read and validate
the user input form command prompt. Now I'm trying to do the same with
1.4 which hasn't got the Scanner class. I'm using:

BufferedReader in = new BufferedReader(new
InputStreamReader(System.in));
System.out.print("Enter age: ");
int name = Integer.parseInt(in.readLine());

to read the user input but I don't know how to validate the data. In
1.5 where I can use the Scanner class I can use the hasNexInt() method
to validate the Integer input. How can I do the same thing in 1.4?

Please help.

.



Relevant Pages

  • Re: Perl output Javascript to validate user input
    ... 2- After user input, the javascript which embed with Perl script to ... So the Perl script merely prints out the Javascript source, ... need to validate on the server. ...
    (comp.lang.perl.misc)
  • Re: IN Clause - Stuck on an easy query :-(
    ... >validate or verify the data. ... not some unknown program to be written by an unknown ... The CHECKconstraints and REFERENCES also provide extra ... I'll give you credit for the novel concept: check user input by ...
    (microsoft.public.sqlserver.programming)
  • RE: How2 accept only numbers in userform textbox
    ... Write code to Validate the user input BEFORE you perform you math functions. ... Private Sub CommandButton1_Click ...
    (microsoft.public.excel.programming)
  • Re: _ttoi function - checking return value
    ... I think that you need to validate the user input, ... the input which you are showing can and will change the value if the user ... beitman AT applieddata DOT net ... Does anyone have any ideas how best to validate user-input such as ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Perl output Javascript to validate user input
    ... 2- After user input, the javascript which embed with Perl script to ... 3- When the validate is okay, the user input will store in the ...
    (comp.lang.perl.misc)