include Tesla.IO; public class iotest { public static void main(String[] args) { //create a StreamWriter from a FileOutputStream that creates the file out.txt StreamWriter sw=new StreamWriter(new FileOutputStream("out.txt")); //write a string to out.txt sw.write("Hello, implementor!").endl(); //close the output stream sw.close(); //create a StreamReader from a FileInputStream that reads from out.txt StreamReader sr=new StreamReader(new FileInputStream("out.txt")); //read a line from out.txt then print it to standard output String s=sr.readLine(); Console.out.write(s).endl(); //close the input stream sr.close(); } }