This post contains my notes for comparison between java 7 and java 6.
1. Java 7 is faster than Java 6 performance wise. Ideally any previous code should run faster on Java 7 with same benchmarks. (Read on couple of blogs, need to do my check.)
2. New and Better Concurrent Garbage Collector in Java 7, called G1. Should be able to handle very large Heaps. Again, need to do my check.
3. Modularization of JDK. Which makes sense, since it will reduce the download size, get only what you actually want, reduced start up time and of course lesser memory footprint.
4. Project Jigsaw - which will happen completely in Open source. Related to #3 modularization, Allow other people to develop modules independently and Sun may (or may not) add these components to future releases of Java.
5. AutoClosable and try with resource - Allows auto closing of resource without the need of writing extra code. This is a new interface that comes with Java 7.
6. New constructor has been added to Throwable class which can be used to enable or disable the suppression of exceptions. If disabled none of the suppressed exceptions are tracked.
7. Strings are allowed in switch block. In older versions of java it gives compilation error. Here's an example program:
1. Java 7 is faster than Java 6 performance wise. Ideally any previous code should run faster on Java 7 with same benchmarks. (Read on couple of blogs, need to do my check.)
2. New and Better Concurrent Garbage Collector in Java 7, called G1. Should be able to handle very large Heaps. Again, need to do my check.
3. Modularization of JDK. Which makes sense, since it will reduce the download size, get only what you actually want, reduced start up time and of course lesser memory footprint.
4. Project Jigsaw - which will happen completely in Open source. Related to #3 modularization, Allow other people to develop modules independently and Sun may (or may not) add these components to future releases of Java.
5. AutoClosable and try with resource - Allows auto closing of resource without the need of writing extra code. This is a new interface that comes with Java 7.
6. New constructor has been added to Throwable class which can be used to enable or disable the suppression of exceptions. If disabled none of the suppressed exceptions are tracked.
7. Strings are allowed in switch block. In older versions of java it gives compilation error. Here's an example program:
public class TestString{ public static void main(String args[]){ String test = "red"; switch(test){ case "red": System.out.println("I am red"); break; case "blue": System.out.println("blue is blue"); break; default: System.out.println("colorless!"); } } }