Originally posted by bill bozeman:
The real answer is that this won't compile. With RandomAccessFile, you need to catch FileNotFoundException and the write methods throw IOException. So you would need to catch these in this method.
However, with that aside, the right answer is B. 7890. Cherry has the right idea, but the wrong answer. A boolean is one bit, but the writeBoolean will write one byte. And int have 4 bytes. So when you seek to the 5th byte, you pass the boolean and the first int, then you read the next int, or next 4 bytes to give you 7890.
Bill
Thankz Bill
You are a compiler.
and the reason why writeBoolean write one byte is because we cant write a one bit value of 1 or 0 in a file and get it to be true and false am i right Bill
Once again thankz Bill