14
任务
Java Collections, 第 2 级, 课程 2
Writing to an existing file
The main() method accepts three arguments:
1) fileName - the path to a file;
2) number - a position in the file;
3) text - the text.
Write text to the fileName file starting at the position indicated by number. The write operation must overwrite the old data in the file.
14
任务
Java Collections, 第 2 级, 课程 2
Using RandomAccessFile
The main() method accepts three arguments:
1) fileName - the path to a file;
2) number - a position in the file;
3) text - the text.
Read text from the file, starting from the position indicated by number. The length is the same as the length of the text passed as the third argument.