Search code examples
javawildcardprintwriter

java Constructor of class Printwriter


In one of the sample code I saw, there is such a line:

PrintWriter pw = new PrintWriter("$$$temp$$$.$$$");

What is the "$" sign mean in this context? Is it something like a wildcard?


Solution

  • $ means nothing in particular which is why its appears to being used here to specify a temporary file name. Chances are a file with this name will not already exist on the filesystem. If you're trying to create a temporary file check out createTempFile