Because “out” in “System.out” is a static PrintStream object, you can create a PrintStream variable, assign “System.out” to it, and reference that object from the new variable instead. Here’s the code:
import java.io.*;
public class TestPrint
{
private static PrintStream out = System.out;
public static void main(String args[])
{
out.println(“Hello, World!”);
out.println(“Testing, one, two, three”);
}
}
Build Your Own Test Framework
-
[image: Build Your Own Test Framework]
Learn to write better automated tests that will dramatically increase your
productivity and have fun while doing so...
44 minutes ago
No comments:
Post a Comment
I'm certainly not an expert, but I'll try my hardest to explain what I do know and research what I don't know.