Results 1 to 3 of 3
Thread: what is the probleam here?
- 12-22-2007, 12:38 PM #1
what is the probleam here?
The out put ispublic static void main(String[] args) {
double a = Double.parseDouble(args[0]);
double b = Double.parseDouble(args[1]);
double sum = a + b;
double prod = a * b;
double quot = a / b;
double rem = a % b;
System.out.println(a + " + " + b + " = " + sum);
System.out.println(a + " * " + b + " = " + prod);
System.out.println(a + " / " + b + " = " + quot);
System.out.println(a + " % " + b + " = " + rem);
System.out.println();
System.out.println("sin(pi/2) = " + Math.sin(Math.PI/2));
System.out.println("log(e) = " + Math.log(Math.E));
}
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0
at Ex3.main(Ex3.java:21)
Process completed.
please help me?:confused:
- 12-22-2007, 12:46 PM #2
hey man ur using any tool or just in command screen ur running the code..
in command screen means..
u run as
java <class name> <a //u hav 2 enter the number > <b //same way as a>
and then compile ok
and moreover u must catch the Exception in the program ok
- 12-22-2007, 01:07 PM #3


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks