• Advertisement
Sign in to follow this  

[java] Java 1.4 or Java 5?

This topic is 4667 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I just started an intro to cs course at uni and we are using java. The link from the courses website says download java 1.4. I noticed at javas website that there is a newer version (Tiger 5.0) and even a video from the creator telling me to download it :) Should i get 5 or the old one? If i get 5, are the changes so much that my code wont work on my teachers computer? I would contact him but its still holidays and i wanted to get a head start :) Thanks for any info

Share this post


Link to post
Share on other sites
Advertisement
There's a compiler flag (something like -target 1.4, check the javadocs) which will generate bytecode for 1.4 VMs. It should also generate warnings if you use any features/classes that aren't avalible in 1.4.

If you use an IDE like Eclipse there's a setting in the compiler options to specify this.

Share this post


Link to post
Share on other sites
Quote:
Original post by OrangyTang
There's a compiler flag (something like -target 1.4, check the javadocs) which will generate bytecode for 1.4 VMs. It should also generate warnings if you use any features/classes that aren't avalible in 1.4.

If you use an IDE like Eclipse there's a setting in the compiler options to specify this.
eclipse is actually pre-set to use the 1.4 compliance.

Share this post


Link to post
Share on other sites
You can't use Java 5.0 with eclipse unless you get the newest stable beta version 3.1 as far as I could see in the recent weeks and even then you have to go in the compiler option and enable it since it is set for 1.4 by default

Share this post


Link to post
Share on other sites
You'll love the features 5 provides... auto-boxing, generics, typesafe enumeration; all good stuff. Get started with 4, but keep 5 in mind.

Share this post


Link to post
Share on other sites
Yeah I'm not sure autoboxing is such a great thing (the way it is done) either, but enumerations and lots of other minor additions should be nice.

Share this post


Link to post
Share on other sites
Enums are a great addition, about time!

Generics are just syntathic sugar, and many people complain on its design. I never ran into trouble with these, but you should learn Collections both the "1.4 way" and the "tiger (Java 5) way".

Auto boxing is a dangerous thing, in my opinion. ints are ints, Integers are Integers. =D

That being said... I still suggest you download Java 5. It's the natural evolution of the language, even with all its bugs and problems, no one will stop it from going stable, replacing 1.4.

Son Of Cain

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement