@@ -0,0 +1,1325 @@
+/**We are writing to a file using the java.io.* package%0AThe classes needed here are: BufferedWriter, FileWriter and IOException;%0A*/%0A%0A//Importing the needed classes%0Aimport java.io.BufferedWriter;%0Aimport java.io.FileWriter;%0Aimport java.io.BufferedReader;%0Aimport java.io.FileReader;%0Aimport java.io.IOException;%0Aimport java.util.Scanner;%0A%0A%0Apublic class WriteToFile %7B%0A%09//Datafield to store the String path for our file name%0A%09private static final String FILENAME = %22BHIM.txt%22;%0A%09%0A%09public static void main(String%5B%5D args)%7B%0A%09%09BufferedWriter bf = null; //Initialize the bufferedwriter object will null%0A%09%09FileWriter fw = null; //Initialize the filewriter object will null%0A%09%09Scanner kb = new Scanner(System.in);%0A%09%09%0A%09%09try%7B%0A%09%09%09%0A%09%09%09//String file = JOptionPane.input.dialog(%22Please enter something here: %22);%0A%09%09%09System.out.println(%22Please enter something here: %22);%0A%09%09%09String statement = kb.nextLine();%0A%09%09%09%0A%09%09%09fw = new FileWriter(FILENAME); // Writing to the File using it's location%0A%09%09%09bf = new BufferedWriter(fw); // Passing the filewriter as a parameter to BufferedWriter%0A%09%09%09bf.write(statement);%0A%09%09%09%0A%09%09%7Dcatch(IOException error)%7B%0A%09%09%09error.printStackTrace();%0A%09%09%7Dfinally%7B%0A%09%09%09try %7B%0A%09%09%09%09%0A%09%09%09%09if(bf !=null)%7B%0A%09%09%09%09%09bf.close();%0A%09%09%09%09%7D%0A%09%09%09%09if(fw !=null)%7B%0A%09%09%09%09%09fw.close();%0A%09%09%09%09%7D%0A%09%09%09%09%0A%09%09%09%7D catch (IOException e)%7B%0A%09%09%09%09e.printStackTrace();%0A%09%09%09%7D%0A%09%09%7D%0A%09%7D%0A%09%0A%7D%0A

Create WriteToFile.java