question: public static void writeToFile ( File file , String contents ) throws IOException { FileOutputStream fos = new FileOutputStream ( file ) ; fos . write ( contents . getBytes ( ) ) ; fos . close ( ) ; }
target:  Writes the contents to the file at the given location (this creates the file or deletes its existing contents.)