Java.io.PrintWriter.println double() 方法


Java.io.PrintWriter.println double() 方法

package com.codingdict;



import java.io.*;



public class PrintWriterDemo {



   public static void main(String[] args) {

      double d = 123.456;



      // create a new writer

      PrintWriter pw = new PrintWriter(System.out);



      // print doubles

      pw.println(d);

      pw.println(987.765);



      // flush the writer

      pw.flush();

   }

}