// JDK 6 Map> altName2msn = new HashMap>(); // JDK 7, Diamond Operator Map> coinName2msn = new HashMap<>(); // JDK 6 OutputStream fos = null; try { fos = new FileOutputStream("ausgabe.txt"); fos.write(42); } catch (IOException exp) { // ... } finally { try { if (fos != null) { fos.close(); } } catch (IOException exp) { // ... } } // JDK 7, Try with Resource and multiple catch try (OutputStream out = new FileOutputStream("ausgabe.txt")) { out.write(42); } catch (ArithmeticException | IOException exp) { // ... } // JDK 6 long SOURCE_ENTITY_TYPE_MASK = Long.parseLong("10000000" + // "00000000" + // "00000000" + // "10000000", 2); // JDK 7 long coin = 0b10000000_00000000_00000000_10000000L; // JDK 7, Datei kopieren File src = new File("eingabe.txt"); File dest = new File("ausgabe.txt"); Files.copy(src.toPath(), dest.toPath(), StandardCopyOption.REPLACE_EXISTING);