●Dec|are public void write File(String fileName, String data) throws IoExceptiont Writer writer= nul: /*may throw an IOEXception * writer= new FileWriter(fileName) / may throw an loException * writer. write(data);Declare public void writeFile(String fileName, String data) throws IOException{ Writer writer = null; /* may throw an IOException */ writer = new FileWriter(fileName); /* may throw an IOException */ writer.write(data); }