- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWriteRandom.java
More file actions
Latest commit
25 lines (22 loc) · 574 Bytes
/
Copy pathWriteRandom.java
File metadata and controls
25 lines (22 loc) · 574 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
packagesepidsal;
importjava.io.*;
/**
*
* @author Sepideh Saljooghi
*/
publicclassWriteRandom {
publicstaticvoidmain(Stringargs[]){
try{
Filefdfile = newFile("C:\\sepidsal.txt");
RandomAccessFilerndFile = newRandomAccessFile(fdfile, "rw");
rndFile.writeUTF("SepidSal");
rndFile.writeInt(52);
rndFile.writeFloat(5.2f);
rndFile.close();
System.out.print("Done!");
}
catch(Exceptione){
System.out.print(e);
}
}
}