Simple class problem
Posted: Thu Jan 16, 2003 8:03 pm
I am having trouple with this simple class:
/** test
* @KPB
*/
public class testofclass
{
static final double RATE = 0.05;
static double purchase;
public static void main(String[] args)
{
double tax;
double total;
purchase=Double.parseDouble(args[0]);
tax = RATE * purchase;
total = purchase + tax;
System.out.println("Total: " + total);
}
}
****
When I compile(which works fine) and run this application, I get this error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at testofclass.main(testofclass.java:14)
Can anyone provide a quick fix?
/** test
* @KPB
*/
public class testofclass
{
static final double RATE = 0.05;
static double purchase;
public static void main(String[] args)
{
double tax;
double total;
purchase=Double.parseDouble(args[0]);
tax = RATE * purchase;
total = purchase + tax;
System.out.println("Total: " + total);
}
}
****
When I compile(which works fine) and run this application, I get this error:
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at testofclass.main(testofclass.java:14)
Can anyone provide a quick fix?