every time I write anything in an empty file and run the main method the whole empty file gets erased
package assignment1;
import java.util.*;
import java.io.*;
public class TestFoodProduct {
public static void main(String[] args) throws FileNotFoundException {
Scanner inFile = new Scanner (new FileReader ("food.data"));
PrintWriter pw = new PrintWriter ("food.data");
}
}