最佳答案
I have a function that takes an object of a certain type, and a PrintStream
to which to print, and outputs a representation of that object. How can I capture this function's output in a String? Specifically, I want to use it as in a toString
method.