- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReadRandom.java
More file actions
Latest commit
28 lines (25 loc) · 709 Bytes
/
Copy pathReadRandom.java
File metadata and controls
28 lines (25 loc) · 709 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
26
27
28
packagesepidsal;
importjava.io.*;
/**
*
* @author Sepideh Saljooghi
*/
publicclassReadRandom {
publicstaticvoidmain(Stringargs[]){
try{
Filefdfile = newFile("C:\\sepidsal.txt");
RandomAccessFilerndFile = newRandomAccessFile(fdfile, "rw");
Strings = rndFile.readUTF();
System.out.println(s);
intnum = rndFile.readInt();
System.out.println(num);
floatfnum= rndFile.readFloat();
System.out.println(fnum);
rndFile.close();
System.out.print("Done!");
}
catch(Exceptione){
System.out.print(e);
}
}
}