This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
In R&H it is given that "Constructing an instance of RandomAccessFile is like constructing an instance of File :No file is created on the file system." But the following code creates ab.txt .
How?Is R&H wrong? Veena
SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
So it does look there is some discrepancy here. Could be that there is no file until the stream get s (maybe) written to, flushed, and closed. What's R&H? -Barry [ August 12, 2002: Message edited by: Barry Gaunt ]
In R&H it is given that "Constructing an instance of RandomAccessFile is like constructing an instance of File :No file is created on the file system."
veena, another point to note in R&H is that RandomAccessFile creates a file if does not exist only if the instance is created in the "rw" mode. if you run the same code in "r", it throws a FileNotFound exception
In R&H it is given that "Constructing an instance of RandomAccessFile is like constructing an instance of File :No file is created on the file system."
Hi Veena, Zarina: Is it possible that R&H is making the point that no phyiscal file will be created on file system immediately after the instance of RandomAccessfile is created. But as soon as you start writing to this file, the file will appear at file system level... Thanks Barkat [ August 12, 2002: Message edited by: Barkat Mardhani ] [ August 12, 2002: Message edited by: Barkat Mardhani ]