please how can i use the RandomAccessFile method-the seek(long n) method to prevent overwritting of data previous written to a text file when i want to perform a new write operation to the same file.....thanks
If you don't want to overwrite data which is in the file already, then you would need to go to the end of the file.
If it were me I would just use an ordinary FileWriter, created with the constructor which preserves the data and makes all the writes append after that. I wouldn't mess about with RandomAccessFile. I also would avoid RandomAccessFile because it's byte-oriented and not char-oriented.