Java.io.PrintStream.println Float() 方法


Java.io.PrintStream.println Float() 方法

package com.codingdict;



import java.io.*;



public class PrintStreamDemo {



   public static void main(String[] args) {

      float c = 1.76348f;



      // create printstream object

      PrintStream ps = new PrintStream(System.out);



      // print a float and change line

      ps.println(c);

      ps.print("New Line");



      // flush the stream

      ps.flush();

   }

}