使用DataOutputStream将双精度写入文件
import java.io.DataOutputStream; import java.io.FileOutputStream; import java.io.IOException;/** 来自 N o w J a v a . c o m**/ public class Main { public static void main(String[] args) { String strFilePath = "C://Folder//WriteDouble.txt"; try{ FileOutputStream fos = new FileOutputStream(strFilePath); DataOutputStream dos = new DataOutputStream(fos); double d = 165; dos.writeDouble(d); dos.close(); }