Java examples for File Path IO:DataOutputStream
Write double to a file using DataOutputStream
import java.io.DataOutputStream; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void main(String[] args) { /* w ww .j a v a 2s. com*/ 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(); } catch (IOException e) { System.out.println("IOException : " + e); } } }