Santhosh Shettigar Santhosh Shettigar - 1 month ago 7
Android Question

How to delete only the content of a file in java?

May i please know how can i delete the content of the file in java?
Thanks in advance.

Answer

How about this:

new RandomAccessFile(fileName).setLength(0);