Problem with a java error (cannot be applied to (java.io.PrintWriter))
Posted on 2009-12-28
Can anybody help me with this Java problem I'm having.
I have a java file with the following commands.
slip = new PaySlip(emp,sum);
slipWrite = new PrintWriter(new FileWriter(args));
In the PaySlip.java file I have this for the printPay method
public void printPay()
netpay = gross - tax;
When I go to compile the main app I get
mainapp.java:80: printPay() in PaySlip cannot be applied to (java.io.PrintWriter)
slip.printPay(slipWrite); // call printPay to calculate and print payslip
Would you know what this means and how to fix it?