PrintWriter?

The oddest thing is happening to me. In a Java agent I’m writing for the web, I can use this line to send output to the browser:

getAgentOutput().println(“Hello World!”);

However, if I try the more conventional method of creating a PrintWriter object to handle the output (PrintWriter pw = getAgentOutput();), I get an error when I try to compile the code: Class PrintWriter not found. What’s up with that?

Subject: PrintWriter?

Did you import the class i.e.:

import java.io.PrintWriter;

or

import java.io.*

Rufus

Subject: RE: PrintWriter?

D’oh! Wasn’t importing the right parts of java.io.