So here's a program that passes command-line arguments. I've never used the parseDouble method before, so I don't know what I'm doing wrong. I'm supposed to convert the elements in the args array to double and add their values. Here's the code:
public class Double
{
public static void main(String[] args)
{
double sum = 0;
double d;
for (String b : args)
{
d = Double.parseDouble(args);
sum += d;
}
System.out.println("Sum of arguments: " + sum);
}
}
I keep getting this error:
symbol : method parseDouble(java.lang.String[])
location: class Double
d = Double.parseDouble(args);
^
1 error
Tool completed with exit code 1