Java.io.PrintStream.print Object() 方法


Java.io.PrintStream.print Object() 方法

package com.codingdict;



import java.io.*;



public class PrintStreamDemo {



   public static void main(String[] args) {

      Object x = 50;

      Object s = "Hello World";



      // create printstream object

      PrintStream ps = new PrintStream(System.out);



      // print objects

      ps.print(x);

      ps.print(s);



      // flush the stream

      ps.flush();

   }

}