Guest User

Untitled

a guest
May 16th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  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;
Add Comment
Please, Sign In to add comment