What is the most efficient class to use to read from and write to console in Java?
+1
A:
BufferedReader and BufferedWriter are the most efficient means of writing to and reading from the console, as well as any file. However, they are relatively difficult to use.
Scanner provides an alternative to retrieving input from the command line, and is much easier to use than BufferedReader.
Swiss
2009-11-17 02:23:50
+1
A:
If you are printing log messages in an application, should use a logging API (log4j or whatever). You then specify which levels (debug, info, warn, ...) print on the console per class.
Logging tends to slow things down dramatically in my experience - so don't log within a tight loop (unless that logging level is typically off in production).
LES2
2009-11-17 02:40:56