Why am I getting errors? Says "Index 0 out of bounds for length 0"
Why am I getting errors?
Says "Index 0 out of bounds for length 0"
I didn't specify when I asked this question last time, the
public static void main(String[] args) {
System.out.println("Enter length and width of rectangle");
for (int i=0; i < args.length; i++)
{
System.out.println(args[i]);
}
Double area= Double.parseDouble (args[0]) * Double.parseDouble (args[1]);
System.out.println(" Area of rectangle is :" + String.format("%.3f", area));
}
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images