java beginner

How We Can read a integer or float value in java language?

Comments

  • [b][red]This message was edited by Moderator at 2003-7-1 10:42:40[/red][/b][hr]
    : How We Can read a integer or float value in java language?
    :
    [purple]
    Type this into your programme

    [code]
    }}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}{}{}{{{}{{}}{((((((
    [/code]

    [/purple]







  • There are alot of ways:
    - if you use the
    BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
    you just raed in strings objects, then you have to convert it to integer or double: Integer.parseInt(string_object); or
    Double.parseDouble(string_object);
    - otherwise, create your own class that read in strings and convert in it to float or integer as the above, the different is that you wrap these whole actions in a method and give it a name, the next time you use it just refer to the class and method name.
    Hope these help

  • Thank You For Your Help Sir.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories