import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; public class cat { public static void main(String [] args) throws IOException { try (FileReader f = new FileReader(args[0])) { while (f.ready()) { System.out.write(f.read()); } f.close(); } catch (FileNotFoundException e) { System.out.println("File not found: " + args[0]); return; } } }