Naturally with a GUI you wont have a console loaded unless you run the command I put above, so if you are having a lot of print statements, does it still affect the speed of your program, and are they still printed?
The best answer for any performance question is to test it. Here's a quick sample program:
import java.io.*;
class Test {
public static void main(String[] args) throws Exception {
// Untimed, for the sake of JIT compilation
for (int i = 0; i < 100000; i++) {
System.out.println("Foo");
}
// Now let's time it.
long start = System.nanoTime();
for (int i = 0; i < 100000; i++) {
System.out.println("Foo");
}
long end = System.nanoTime();
String outputPath = "c:\\users\\jon\\test\\results.txt";
try (FileWriter writer = new FileWriter(outputPath)) {
writer.write((end - start) + " nanoseconds");
}
}
}
Running this from a console, but hiding it, on my laptop I get a result of 5604097078 nanoseconds.
Running it from Windows explorer, so there's no output, I get a result of 3339245234 nanoseconds. (Obviously I've run it a few times - those are just typical results.) So while it's significantly more efficient to write to a console which isn't actually doing anything, it's far from free. Whether it's a problem in your application is a different matter.
And no, the output really isn't written anywhere, as far as I'm aware. If you're using this for logging, you'd be better off using a dedicated logging package, which will allow you to disable it for much more efficient no-op logging, and also allow you to log to a specific file or wherever you want.