Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

conversion(java.lang.String) in TextFileProcessorcannot be applied to (java.io.P

ID: 3618100 • Letter: C

Question

conversion(java.lang.String) in TextFileProcessorcannot be applied to (java.io.PrintWriter)
  TextFileProcessor.conversion(outputStream);
                  ^ This is the error I am getting. outPutStream is the variablefor a text file. I need to pass that file to another method to beprocessed. conversion(java.lang.String) in TextFileProcessorcannot be applied to (java.io.PrintWriter)
  TextFileProcessor.conversion(outputStream);
                  ^ This is the error I am getting. outPutStream is the variablefor a text file. I need to pass that file to another method to beprocessed. This is the error I am getting. outPutStream is the variablefor a text file. I need to pass that file to another method to beprocessed.

Explanation / Answer

You're trying to pass a PrintWriter to a method that requires aString. Call the conversion on a String, then print it usingthe PrintWriter.