Java.io.PrintWriter.print int() 方法 Java.io.PrintWriter.print float() 方法 Java.io.PrintWriter.print long() 方法 Java.io.PrintWriter.print int() 方法 package com.codingdict; import java.io.*; public class PrintWriterDemo { public static void main(String[] args) { int i = 1234; // create a new writer PrintWriter pw = new PrintWriter(System.out); // print int pw.print(i); // change the line pw.println(); // print another int pw.print(567); // flush the writer pw.flush(); } } Java.io.PrintWriter.print float() 方法 Java.io.PrintWriter.print long() 方法