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”);
}
}
I Tried Google IT Support Professional Certificate on Coursera and It's
Awesome
-
[image: Is Google IT Support Professional Certificate Worth It]
Hello guys, if you want to start your career in the IT support field and
looking for resour...
1 day 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.