View Single Post
Old 04-16-2004, 07:47 PM   #2 (permalink)
firebirdta
Crazy
 
The big error is that in your if statement, you are using == instead of .equals to do the comparison. == only works for primitive data types. Since a String is a referential data type, you have to use .equals.

So,

if( args[ 1 ].equals( "x" ) )
...


As far as taking a String argument and casting it to an int, Integer.parseInt works pretty well.
__________________
"Even if you prove me wrong, I'm not going to believe you." - A. McGill
firebirdta is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52