the method in type not applicable for the arguments

后端 未结 4 1887
挽巷
挽巷 2020-12-20 10:53

I am getting this error message:

2 errors found:

Error: The method determineTaxRate(double) in the type PayCalculator is not applicable for

4条回答
  •  庸人自扰
    2020-12-20 11:03

    You haven't specified arguments for the methods which you are calling from printData() method, for example:

    System.out.println("Net Pay: " + calculateNetPay());
    

    You are calling calculateNetPay() with 0 arguments, where as in your method defnition you have specified, it needs 2 double arguments.

    public double calculateNetPay(double grossPay, double tax) { ... }
    

    Same applies for other errors you are getting.

提交回复
热议问题