daily pastebin goal
15%
SHARE
TWEET

Untitled

a guest May 16th, 2018 87 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import java.io.*;
  2.  
  3. class WriteData
  4. {
  5.    public static void main(String args[])
  6.    {
  7.       try
  8.       {
  9.          DataOutputStream dataOut = new DataOutputStream(new FileOutputStream("c:\\data.txt"));
  10.          dataOut.writeInt(100);
  11.          dataOut.writeChar('\n');
  12.          dataOut.writeDouble(9.8);
  13.          dataOut.writeChar('\n');
  14.          dataOut.writeUTF("Bert Wachsmuth");
  15.          dataOut.close();
  16.       }
  17.       catch(IOException e)
  18.    {
  19.          System.out.println("Problem creating file");
  20. }
  21.  
  22. WriteData;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top