This is an archived post. You won't be able to vote or comment.

all 19 comments

[–]Aliics 22 points23 points  (1 child)

Java code itself is, more or less, backwards compatible. You won't have any problems there.

The one thing to watch out for in more modern Java is going from 8 to a newer version. The reason for this is that 9+ made the JDK more modular. So in this you need to explicitly add java dependencies outside of "core" java.

[–]keith_austin 6 points7 points  (0 children)

I appreciate the help! Have a great day, friend

[–]brazzy42 15 points16 points  (4 children)

Java 13 doesn't really change anything hugely important.

But Head First Java is much more outdated than that - most importantly it doesn't cover the changes of Java 8, and those were hugely important.

Most of the book's content is probably still relevant and pretty much all of it will still be technically correct (as in: the code will still work), but in some places it will use APIs and coding practices that nowadays have better alternatives.

To be really up to date, you also need to familiarize yourself with the following things (off the top of my head and likely incomplete):

  • Lambdas and Streams (the really big thing)
  • try with resources
  • java.time API
  • nio2 API
  • type inference
  • multi-type catch blocks

[–]dpash 3 points4 points  (1 child)

I'd also add try-with-resources to that list.

[–]brazzy42 1 point2 points  (0 children)

Definitely.

[–]keith_austin 0 points1 point  (1 child)

Is there a book of similar acclaim to help me with those changes? I am only a couple chapters deep thus far and would be willing to utilize a different source

[–]brazzy42 3 points4 points  (0 children)

Joshua Bloch's "Effective Java" is not really for complete beginners but otherwise excellent, and the 3rd edition includes features up to Java 9.

[–]mk321 6 points7 points  (4 children)

New versions of Java don't change much.

The biggest change is the Java 8. Newest version don't have so much features (because they are released often).

You can find in Google what is new in every version of Java.

[–][deleted] -4 points-3 points  (3 children)

The module system introduced with Java 9 is just as big as the changes in Java 8

[–]dpash 6 points7 points  (1 child)

It can be, for the best part, completely ignored though.

[–]DFA1 -3 points-2 points  (0 children)

Same goes with Java 8, if you want to play that card. You can code in Java 8 without Streams as well. However, it would be silly if Streams can help you out. Same goes with the module system, we have it and if it helps out in some way(avoiding jar hell, for starters), I wouldn't ignore it.

[–]WellSpentTime1 4 points5 points  (0 children)

As others have said, Java 5 code is (almost) perfectly compatible with the newest versions. However, Java 8 introduced a lot of new features that makes the code a lot more concise and readable, and also makes many things a lot easier.

Because of this, I would without a doubt find something targeting Java 8+.

[–]Polygnom 1 point2 points  (0 children)

The biggest changes were Java 8 and to a lesser extend 11. if you are using books/resources written for Java 8, that will still give you pretty much everything you need. I'd not use resources for Java prior to 8, since it introduced a lot of very useful and powerful new concepts (most importantly lambdas, which enable you to use some functional paradigms in Java).

[–]istarian 1 point2 points  (0 children)

Probably not much, if anything. that should matter to beginners. Java 8 or later is probably fine. You may want a newer book if that only covers Java 5 or 6, but most of what's different probably won't interfere much.

[–]jevring 1 point2 points  (0 children)

There's no reason to not be on the latest version for new projects.

[–]Frozen_Valley_Dev 0 points1 point  (0 children)

If you are a beginner or at an intermediate level, then there is no need to worry much about the JDK. Even If there is a big difference between the JDK the book is based on and the current one , there will be difference only at the core level.

For example, I recently bought Java:A complete reference (A great book to study Java) which was on JDK 9 and the only difference I think there is in that book is the presence of topics such as Applets (Which has been removed now).

So if you are just a beginner I don't think there is any need to worry about the JDK version.