Learning Java 5 with Java 7

109 views Asked by At

I am studying a book -with a course- that is using Java 5.0 (1.5) And my machine has a Java 7 version (1.7.0_65) Would this cause me any type of syntax headache or slow my pace by any means? Thanks in advance.

4

There are 4 answers

4
peter.petrov On BEST ANSWER

Java is always very careful about being backward-compatible. So if you use a newer version of the JDK to program, while writing code in an older syntax, that should be no problem in general.

0
Chiron On

It should be ok. Generics syntax changed a bit.

In Java 5:

List<String> names = new ArrayList<String>;

In Java 7:

List<String> names = new ArrayList<>();

Of course, Java 5 generics syntax is still accepted in Java 7.

0
Pedro Montoto García On

Everything you can do in Java 5, you can do it exactly the same way in Java 7 since Java after version 5 is intentionally retrocompatible.. The converse is not true and you'd be better off studiying Java 8 directly, since it's the new version.

0
vmcloud On

There isn't any problem, as java is a language that deal with compatible very well. And it is very stable. The language has few changes since Java 5. Go ahead, good luck!