In general, there are a number of fairly broad changes to make things easier on the programmer. Your manager might not care too much about such things, but making programmers spend less time thinking about boilerplate code, and thus have more time to think about the actual goal of what they're implementing, should increase efficiency, decrease bugs, etc., which can be a very powerful argument. Oracle has a fairly extensive list of changes, but it's rather lengthy, so I'll summarize as much as possible.
Language features include:
- Less boilerplate on Generics. The code
Map<String, String> myMap = new HashMap<String, String>();
can be reduced to Map<String, String> myMap = new HashMap<>()
. The compiler can infer the Generic types needed on the right side from the left, so your code gets a little shorter and quicker to read.
- Strings work in switch statements now, using the semantics of the
.equals()
method instead of ==
.
- Automatic resource management using try-with-resources. This makes code cleaner, but also has an advantage over old-style try/finally-based code. If an exception is thrown in the try statement, and then another is thrown while closing, code which uses traditional try/finally statements will completely lose the original exception, and only pass up the one which was thrown in the finally block. In a try-with-resources statement, the runtime will suppress the exception that the close() calls threw, and bubble the original exception up the stack, under the assumption that this original exception is the one that caused all the problems in the first place. Additionally, instead of abandoning the other exception to the garbage collector, this suppression allows the close-thrown exceptions to be retrieved using
Throwable.getSuppressed
.
- Numeric literals can be made easier to read. All numeric literals allow underscores, so things like
int n = 1000000000
can be made into a much more readable int n = 1_000_000_000
, which is much easier to parse as being one billion, and harder to type wrongly without noticing. Also, binary literals are allowed in the form 0b10110101
, making code that works with bit-fields a little nicer to read.
- Handling multiple exception types int the same catch statement can be done, reducing duplicating code, and potentially making it easier to refactor later.
Every one of these changes is something your manager might not directly care about, but they make it a little bit easier to write correct code without as much effort and thought, freeing your mind to focus a little more on the actual logic you're trying to implement, and they also make it a little easier to read code later, making debugging a little faster.
On the API side, a number of API updates have also occurred:
- Security-wise, several encryption methods have been added/deprecated, as crypto moves ever forward.
- File IO has been changed, (this might be a better link, though ) adding some better abstraction in a number of places. I haven't personally dived into the new IO stuff, but it looks like a very useful overhaul, making it much easier to work with the filesystem without quite as much pain.
- Unicode Support is up to Unicode 6.0, along with a number of other internationalization enhancements.
- Java2D, which you mentioned in your question, has been improved. Better Linux font support, better X11 rendering on modern machines, and handling of Tibetan scripts.