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
|