tags:

views:

145

answers:

4

I started a little contract job that requires me to use Java. I was given a Java book by the project manager, but it covers Java 1.3 and I understand that Java is now around 1.6. I would like to know if there are any major core additions to the language that I can read up to after getting the basics down with this book?

+5  A: 

I would dump any book that is that old, and get (or even buy at my own expense) one that is newer. Are you supposed to work against 1.3 code bases?

Major changes include:

  • Generics

  • Collection framework rework

  • enumerations

  • The aggregated weight of several versions of API changes

  • Better API for concurrency

  • Boxing (not that big a deal IMHO)

Uri
Thanks, I'll make sure to find out what version I'll be working against. I just know it is J2ME right now.
Dr. Watson
The Java 2 Mobile Edition is a stripped down version of Java for Mobile devices (phones and PDAs mostly.) You will need two books. A basic Java introduction and one on J2ME. http://java.sun.com/javame/index.jsp
Chris Nava
And the J2ME profile he's targeting may be based on J2SE 1.3 - http://en.wikibooks.org/wiki/J2ME_Programming/The_J2ME_Platform gives a good comparison of the different profiles.
Nate
Don't underestimate autoboxing and unboxing. It's important to be aware of how it works, otherwise the behaviour of Java programs might be surprising to you.
Jesper
Which "collection framework rework" did you refer to? The introduction of the collections framework (List, Collection, Map, Set, ...) was in the Java 1.2 timeframe.
Joachim Sauer
@Joachim: Yes, but making the migration to generics was a rework. In addition, it made the use of things like apache-collections that hasn't migrated less practical.
Uri
+12  A: 
Zed
lol ! well said.
Silence
A: 

There is a big difference between Java 1.3 and Java 6.

A number of major language enhancements were added in Java 5: generics, an enhanced for-loop syntax, autoboxing and unboxing, typesafe enums, varargs, static imports and annotations. Read more about those changes here.

Besides that, the standard Java library has a number of new features, including APIs for working with XML (javax.xml), non-blocking I/O (java.nio), efficient concurrency APIs (javax.util.concurrent), scripting (javax.script) and much more.

A book about Java 1.3 is hopelessly out-of-date and you'll especially miss the Java 5 language features. Things like generics and annotations are not trivial changes. Buy a new book.

Sun also has an excellent set of online tutorials, which is most likely worth more than your old Java 1.3 book.

Jesper
A: 

The Java language has grown larger and more complex from version 1.3 to 6, but is still backwards compatible, so you will be able to work with Java 1.3 sources effortly.

You will need a suitable compiler though. If you use Eclipse, just set the compiler to conform to Java 1.3.

When you have your head around the Java 1.3 core, you can easily (heh) step up to the new stuff in Java 5. Espcially Generics take some getting used to.

Thorbjørn Ravn Andersen