I am almost complete but when I compile I get the error \"Method getUserTax in class IncomeTax cannot be applied to given types; required double; found: no arguments; reason: ac
Just change this method signature: -
public static double getUserTax(double income)
to: -
public static double getUserTax()
You don't need to pass any income
parameter, as that you are already having income
as instance attribute in IncomeTax
class. And when you invoke this method on an IncomeTax
instance: -
test.getUserTax();
the income
used in the method is nothing but this.income
, which references the instance attribute.