delete line from text file

hi, In java how can I delete particular line from text file. Any kind of help will be appriciated.
[119 byte] By [amey.nirgudea] at [2007-10-2 6:39:49]
# 1

Read the file line by line and write each line out to a temp file as you read it. When you get to the line you want to delete, simply don't write it out. When you've gone through the whole file, rename the temp file to the original. (You might have to explicitly delete the original first, I'm not sure.)

targaryena at 2007-7-16 13:47:57 > top of Java-index,Java Essentials,Java Programming...