Java PrintStream.println(boolean x)
Syntax
PrintStream.println(boolean x) has the following syntax.
public void println(boolean x)
Example
In the following code shows how to use PrintStream.println(boolean x) method.
/* w w w . j av a2 s . c o m*/
import java.io.*;
public class Main {
public static void main(String[] args) {
PrintStream ps = new PrintStream(System.out);
// print a boolean and change line
ps.println(true);
ps.print("from java2s.com");
// flush the stream
ps.flush();
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »