[Solved] Can’t return the answer


You are returning an array. The salary is in the the first position of you array. If you want to see the salary you would need to use

return salary[0];

in your method.

or

System.out.println(calculateSalary(salary,riseRate)[0]);

in the main.

What you’re trying to print right now is the actual array, not a value.

I am not sure why you are doing it like this, though.
Why not just use a double instead of double[]?

1

solved Can’t return the answer