Java PrintStream.print(int i)
Syntax
PrintStream.print(int i) has the following syntax.
public void print(int i)
Example
In the following code shows how to use PrintStream.print(int i) method.
/* w ww .j ava2s. c om*/
import java.io.*;
public class Main {
public static void main(String[] args) {
int x = 123;
PrintStream ps = new PrintStream(System.out);
// print integer
ps.print(x);
ps.print(100);
// flush the stream
ps.flush();
}
}
The code above generates the following result.
Home »
Java Tutorial »
java.io »
Java Tutorial »
java.io »