135k views
3 votes
Which of the following classes has a static variable that is commonly used when communicating with standard output?

a) Scanner.
b) String.
c) System.
d) Object.

User Sean Ford
by
8.0k points

1 Answer

3 votes

Final answer:

The correct answer is c) System. The System class in Java has a static variable called out which is commonly used when communicating with standard output.

Step-by-step explanation:

The correct answer is c) System.

The System class in Java has a static variable called out which is commonly used when communicating with standard output. This variable is an instance of the PrintStream class and allows you to print text to the console.

For example, you can use the System.out.println() method to display a message on the console:


System.out.println("Hello, World!");

User Cryp
by
8.6k points