This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
Below is a question on IO from JavaCaps mock exam#1 :
The correct answer is B) I am not clear as to how the data will be stored, and how the seek will locate position 5. I know that seek is used to the next read operation and starts from index 0. Can some one explain to me . Thanks a lot
Richard Barnes
Greenhorn
Joined: May 17, 2001
Posts: 6
posted
0
Hi, The seek() method works in bytes. The boolean value at the start will take up 1 byte (even though a boolean is actually only 1 bit long) at position 0, then the first int will take up the next 4 bytes (postions 1,2,3 and 4). Position 5 would be the first byte of the second int and hence the second int is displayed. Regards, Richard