So I have a method that outputs to the console
E.g.
public static void printing(){
System.out.println("33.3");
}
When I call this method in main, it should output 33.3 I want to be able to intercept it before it appears on the console so I can manipulate the data and save it to a variable.
So I found this
Redirect console output to string in Java
But I have trouble understanding the concept. How can I save the output as String and not really print anything to the console in the end?