Hi,

On 23 Jan., 18:19, Rodel Bosque <[email protected]> wrote:
> hi guys,
>
> how to determine arguments if its a String or an integer?
>
> ex:
> args[0] = "ABC"
> args[1] = "10"
> args[2] = "DEF"
> args[3] = "20"
>
> as far as i know arguments is an array of String.
>
> if i use Integer.parseInt(args[0]) there is an error occured.
>
> can you help me explain what should i do.

You can catch the thrown NumberFormatException thrown by
Integer.parseInt() and when this exception is thrown,
It isn't an integer.

HTH
Ewald

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaprogrammingwithpassion?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to