import easyIO.*; import java.io.*; class Filkopi { public static void main(String[] args) { Out ut = null; try { InExp inn = new InExp(args[0]); ut = new Out(args[0] + ".copy"); while (!inn.endOfFile()) { ut.outln(inn.readLine()); } ut.close(); // her lukkes fila... } catch (IOException e) { // Hvis en IO-feil oppstår kommer vi hit. System.out.println("Feil ved lesing fra fil."); if (ut != null) { ut.close(); // og her lukkes fila... } } catch (ArrayIndexOutOfBoundsException a) { // Hvis en array-feil oppstår kommer vi hit. System.out.println("Oppgi et filnavn ved " + "programstart"); } } }