what's wrong in this code:
import java.io.*;
public class WriteFile{
public static void main(String[] args) throws IOException{
BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
FileOutputStream fop = new FileOutputStream(f);
File f = new File("textfile1.txt");
System.out.print("Enter your name: ");
String winner1 = input.readLine();
System.out.print("Enter name1");
String winner2 = input.readLine();
System.out.print("Enter name2");
String winner3 = input.readLine();
System.out.print("Enter name3");
String winner4 = input.readLine();
System.out.print("Enter name4");
if(f.exists()){
String str= winner1;
String str2= winner2;
String str3= winner3;
String str4= winner4;
fop.write(str.getBytes());
fop.write(str2.getBytes());
fop.write(str3.getBytes());
fop.write(str4.getBytes());
fop.flush();
fop.close();
System.out.println("The data has been written");
}
else
System.out.println("This file is not exist");
}
}