This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
R&H says "java's random access files only support seeking relative to the begining of the file,but there are methods that report their current position and length of the file,so it can effectively perform other kinds of seek as long as u are willing to do arithmetic" and in the sumarry says " RAF seeks to any position within a file" i dont really understand this point 'cause my lecturer said that RAF supports seeking relative to the begining of the file and in mock exams that i have taken it also says so(R&H's mock exam) if the book says it has methods to seek in any position why does it says it seeks relative to the begging of the file? it has gotten me real confused and some help would be appreciated khella smith
Java only has a function to go to a position relative to the beginning, as R&H says. The book also points that you can move to spots like the second to last character by going to the location fileLenth - 3, or five characters back with currentPosition - 5. This is the alternative to a non-existant function like seekFromEnd(2) or goBack(5). The fact that you can seek any point in the file doesn't conflict with anything. If you couldn't seek any point in the file, it wouldn't really be random access . That's all the book is saying. David Weitzman [ May 07, 2002: Message edited by: David Weitzman ]
Joined: May 06, 2002
thanxs alot david its clearer now i kinda get it with ur explanation it helped alot
khella smith [ May 08, 2002: Message edited by: khella smith ]