PrintWriter: println(int x) : PrintWriter « java.io « Java by API






PrintWriter: println(int x)

 
import java.io.IOException;
import java.io.PrintWriter;

public class Main {
  public static void main(String[] args) {
    try {
      PrintWriter pw = new PrintWriter("c:\\temp\\printWriterOutput.txt");
      pw.println("PrintWriter is easy to use.");
      pw.println(1234);
      pw.close();
    } catch (IOException e) {
    }
  }
}

   
  








Related examples in the same category

1.new PipedWriter()
2.new PrintWriter(BufferedWriter, boolean autoFlush)
3.new PrintWriter(Writer out)
4.PrintWriter: close()
5.PrintWriter: print(char c)
6.PrintWriter: print(int i)
7.PrintWriter: println(Object x)
8.PrintWriter: println(String x)
9.PrintWriter: println(char x)
10.PrintWriter: println(double x)
11.PrintWriter: println(float x)
12.PrintWriter: println(long x)
13.PrintWriter: println()
14.Writer: write(char[] cbuf)