[java] Java 1.4 or Java 5?
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
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.
If you use an IDE like Eclipse there's a setting in the compiler options to specify this.
Quote:Original post by OrangyTangeclipse is actually pre-set to use the 1.4 compliance.
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.
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
You'll love the features 5 provides... auto-boxing, generics, typesafe enumeration; all good stuff. Get started with 4, but keep 5 in mind.
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.
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement