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.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.