// JDBC 4.0: no Class.forName() needed // (Assuming driver in classpath) // Old-style file I/O BufferedReader reader = null; try reader = new BufferedReader(new FileReader("data.txt")); String line; while ((line = reader.readLine()) != null) System.out.println(line); finally if (reader != null) reader.close(); // No diamond: must repeat generic types Map<String, List<Integer>> map = new HashMap<String, List<Integer>>();
| Feature | What it did | |---------|--------------| | | Introduced low-pause, region-based GC. Became default much later (Java 9). | | Escape Analysis | JVM could allocate objects on the stack instead of the heap if they didn't escape a method. Huge performance win. | | Synchronization optimizations | Lock coarsening, lock elision, biased locking. | | Improved JVM TI (Tool Interface) | Better profiling, debugging, and monitoring tools. | java 6.0