aspose file tools*
The moose likes Java in General and the fly likes Cannot be applied to (java.io.PrintWriter) error    Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Cannot be applied to (java.io.PrintWriter) error    " Watch "Cannot be applied to (java.io.PrintWriter) error    " New topic
Author

Cannot be applied to (java.io.PrintWriter) error

Rob Long
Greenhorn

Joined: Jan 06, 2009
Posts: 2
Hi guys I get the following errors when trying to compile this PayApp program and I was wondering how to solve it
printPay() in PaySlip cannot be applied to (java.io.PrintWriter)
slip.printPay(slipWrite)
Gamini Sirisena
Ranch Hand

Joined: Aug 05, 2008
Posts: 347
Read the error again.
Try to relate the information (keywords, identifiers etc.) given in the error to your program and find what might be wrong.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Extra hint, what variables does the method that you are calling take? Take a look at your method signature....


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Rob Long
Greenhorn

Joined: Jan 06, 2009
Posts: 2
Hi,

Thanks for the advice so far. I have removed the slipwrite within the brackets and the program runs ok. I was wondering if this would effect my ability to write results to a txt file for example.
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

Well writing to a file would involve different APIs, I'd recommend starting at the Sun tutorial.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Cannot be applied to (java.io.PrintWriter) error