hello,
This is the question from the javacaps .
17. What is the output displayed by the following code?
import java.io.*;
public class TestIPApp {
public static void main(
String args[]) throws IOException {
RandomAccessFile file = new RandomAccessFile("test.txt", "rw");
file.writeBoolean(true);
file.writeInt(123456);
file.writeInt(7890);
file.writeLong(1000000);
file.writeInt(777);
file.writeFloat(.0001f);
file.seek(5);
System.out.println(file.readInt());
file.close();
}
}
[a] 123456
[b] 7890
[c] 1000000
[d] .0001
the answer given is b.7890
I know the concept of randomaccessfile,but i am not getting why this is the output.
please help,
archana
[email protected]