import java.io.*; public class WriteMessage { public static void main(String Args[]) { String message = "Hello Zero, i hope this is a satisfactory attempt"; try { FileOutputStream out = new FileOutputStream("message.txt"); PrintStream p = new PrintStream( out ); p.println(message); p.close(); }catch (IOException e){ System.err.println ("Error writing to file"); } } }