toString() method within System.out.println() a double call?
A professor of mine once said that the following code should never be done: System.out.println(object.toString()); He said (and I believe cited "Effective Java") it causes a double call. Since the print statement calls the toString method of an object, it would be less efficient to have the toString method called twice. The preferred method would be to just use: System.out.println(object); Obviously this way looks better in code and would save time. I will always do it like this no matter what, but my question is "Is this actually more EFFICIENT?". In looking through the PrintStream