使用DataOutputStream将float写入文件
import java.io.DataOutputStream; import java.io.FileOutputStream;//n o w j a v a . c o m - 时代Java import java.io.IOException; public class Main { public static void main(String[] args) { String strFilePath = "C:/Folder/WriteFloat.txt"; try { FileOutputStream fos = new FileOutputStream(strFilePath); DataOutputStream dos = new DataOutputStream(fos); float f = 1.123f; dos.writeFloat(f); /** * NowJava.com - 时 代 Java 提 供 **/ dos.cl