public class bank
{
public static void main(
String argv[])
{
int balanceAMT = Integer.parseInt(argv[0]);
int withdrawnAMT = Integer.parseInt(argv[1]);
int newbalanceAMT = 0;
if(balanceAMT > withdrawnAMT)
{
newbalanceAMT = balanceAMT - withdrawnAMT;
System.out.println("The amount withdrawn is " +withdrawnAMT);
System.out.println("The balance now is " +newbalanceAMT);
}
System.out.println("End of Program");
}
}
I can compile, but attempting to run results in an ArrayIndexOutofBoundsException. What am I missing? Any help would be appreciated. Thanks.