I'm about to jump into Java development again after a number of years. The language revision I worked with was 1.4.2. I know there have been significant changes to the language since then, and I'm looking for a site or a book that covers these in some detail. At the very least, I'm looking for a resource that indicates which language features were added in which revision, so I can at a glance skip the sections I'm already familiar with. Any suggestions ?
The Wikipedia entry seems concise enough for what you want to look at.
Extract:
J2SE 5.0 (September 30, 2004)
Codename Tiger. (Originally numbered 1.5, which is still used as the internal version number.) Developed under JSR 176, Tiger added a number of significant new language features:
- Generics: Provides compile-time (static) type safety for collections and eliminates the need for most typecasts (type conversion). (Specified by JSR 14.)
- Metadata: Also called annotations; allows language constructs such as classes and methods to be tagged with additional data, which can then be processed by metadata-aware utilities. (Specified by JSR 175.)
- Autoboxing/unboxing: Automatic conversions between primitive types (such as int) and primitive wrapper classes (such as Integer). (Specified by JSR 201.)
- Enumerations: The enum keyword creates a typesafe, ordered list of values (such as Day.MONDAY, Day.TUESDAY, etc.). Previously this could only be achieved by non-typesafe constant integers or manually constructed classes (typesafe enum pattern). (Specified by JSR 201.)
- Swing: New skinnable look and feel, called synth.
- Varargs: The last parameter of a method can now be declared using a type name followed by three dots (e.g. void drawtext(String... lines)). In the calling code any number of parameters of that type can be used and they are then placed in an array to be passed to the method, or alternatively the calling code can pass an array of that type.
- Enhanced for each loop: The for loop syntax is extended with special syntax for iterating over each member of either an array or any Iterable, such as the standard Collection classes (Specified by JSR 201.)
- Fix the previously broken semantics of the Java Memory Model, which defines how threads interact through memory.
- Automatic stub generation for RMI objects.
static imports
1.5.0_17 (5u17) is the last release of Java to officially support the Microsoft Windows 9x line (Windows 95, Windows 98, Windows ME). [1] Unofficially, Java SE 6 Update 7 (1.6.0.7) is the last version of Java to be shown working on this family of operating systems.
- The concurrency utilities in package java.util.concurrent.
J2SE 5.0 entered its end-of-life on 2008 April 8 and will be unsupported by Sun as of 2009 October 30.
Java SE 6 (December 11, 2006)
Codename Mustang. As of this version, Sun replaced the name "J2SE" with Java SE and dropped the ".0" from the version number. Internal numbering for developers remains 1.6.0. This version was developed under JSR 270.
During the development phase, new builds including enhancements and bug fixes were released approximately weekly. Beta versions were released in February and June 2006, leading up to a final release that occurred on December 11, 2006. The current revision is Update 12 which was released in February 2009.
Major changes included in this version:
- Support for older Win9x versions dropped. Unofficially Java 6 Update 7 is the last release of Java shown to work on these versions of Windows. This is believed to be due to the major changes in Update 10.
- Scripting Language Support (JSR 223): Generic API for tight integration with scripting languages, and built-in Mozilla Javascript Rhino integration
- Dramatic performance improvements for the core platform[17][18], and Swing.
- Improved Web Service support through JAX-WS (JSR 224)
- JDBC 4.0 support (JSR 221).
- Java Compiler API (JSR 199): an API allowing a Java program to select and invoke a Java Compiler programmatically.
- Upgrade of JAXB to version 2.0: Including integration of a StAX parser.
- Support for pluggable annotations (JSR 269).
- Many GUI improvements, such as integration of SwingWorker in the API, table sorting and filtering, and true Swing double-buffering (eliminating the gray-area effect).
Java SE 6 Update 10
Java SE 6 Update 10 (previously known as Java SE 6 Update N), while it does not change any public API, is meant as a major enhancement in terms of end-user usability. The release version is currently available for download.
Major changes for this update include:
- Java Deployment Toolkit, a set of JavaScript functions to ease the deployment of applets and Java Web Start applications.
- Java Kernel, a small installer including only the most commonly used JRE classes. Other packages are downloaded when needed.
- Enhanced updater.
- Enhanced versioning and pack200 support: server-side support is no longer required.
- Java Quick Starter, to improve cold start-up time.
- Improved performance of Java2D graphics primitives on Windows, using Direct3D and hardware acceleration.
- A new Swing look and feel called Nimbus and based on synth.[23]
- Next-Generation Java Plug-In: applets now run in a separate process and support many features of Web Start applications
You could check out the Sun website. You can find the changes in Java 5 and Java 6. I think most of the significant language changes came in Java 5 with Generics, Autoboxing, Varargs, Enums etc.
Here's Sun's list of new features in Java 5.
There are many, and they are very fundmental.
In comparison, I don't think there were any changes to the language itself in Java 6 at all.
I was in the same boat as you about a year back and found Java 1.5 Tiger A Developer's Notebook to be very useful as a crash course in the major changes between 1.4 and 1.5. It will get you up to speed. Then you can use sun's website or other resources to learn in depth.
The main features in Java 6 I find I couldn't live without are, by order of importance:
- Generics: allowing the language to know about type parameters (member object types in collections, containers, factories...)
- Autoboxing: automatic conversion of primitive types into objects and vice-versa
- Covariant return-type overriding: similar to polymorphism, lets you override methods with a more specific return type.