最佳答案
I have one method whose return type is void
and it prints directly on console.
However I need that output in a String so that I can work on it.
As I can't make any changes to the method with return type void
I have to redirect that output to a String.
How can I redirect it in Java?