• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Potential "gotchas" in 5.0?

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all let me add my welcome to Herbert Schildt - I know we all appreciate you taking the time to join us in the Forums!
As a relative newbie to Java programming (just certified last month) the applicability of some of the new features may not be as immediately obvious to me as it does to more veteran programmers. But in any case, I was wondering if there are any potential compatibility issues with 5.0 and older java applications?

Thanks,
Mike
 
Ranch Hand
Posts: 1011
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not say 100% compatible. But the old code should be running with little problems or little changes running within the newer JRE.
The principle is to do all-around testing before you migrate the older version code into the newer one.
 
author
Posts: 799
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you named anything "enum" (e.g. Enumeration enum = vector.elements()), you'll want to change that.

-J-
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks!
 
Author
Posts: 253
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Michael:

I have been using both Beta 1 and Beta 2 extensively, and have tested reams of old code. Here are the issues that I know of.

1. As Jeff points out, if you used enum as a variable name, for example, then that code will break because enum is now a keyword.

2. You will definitely receive warning messages when you try to compile legacy code that makes use of any API that has been upgraded to generics. This includes nearly all of the Collections Framework. It also includes the Class class and the Comparable interface, among several others. Although it usually isn't hard to update your legacy code to generics, sometimes it is! You will just have to bear with it.

3. Various little "surprises" here and there, as there are with any new version of Java. But, nothing major.

In all honestly, compatiblity with legacy code has been very good.
 
Ranch Hand
Posts: 1312
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can check compatibilityof Java Tiger with previous java version at

http://java.sun.com/j2se/1.5.0/compatibility.html


 
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Herb Schildt:
3. Various little "surprises" here and there, as there are with any new version of Java. But, nothing major.



So we also have to adapt the example codes in your book here and there to compatible with the final release of JDK... Haven't we? :roll:
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ko Ko Naing:


So we also have to adapt the example codes in your book here and there to compatible with the final release of JDK... Haven't we? :roll:



Hopefully there wont be major changes. I hope that Herb will provide the new code in his website.
 
Michael Cleary
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all! It doesn't sound like compatibility should be much of an issue. I'm itching to start playing w/ 5.0, but certain groups in my company are pretty slow to upgrade anything. :roll: And since the app I'm working on is "owned" by others I'll have to stick w/ the status quo for now...
 
Herb Schildt
Author
Posts: 253
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ko Ko:

The feature set of Java 2, v5 is very stable at this point and I fully expect all of the code in my book to run correctly with the released version. The issues of compatibility apply to legacy code not written for version 5.

Again, I have encountered very, very few backward compatibility issues (beyond those I mentioned).

Also, if you wait for the release of version 5 before you start working with it, you will definitely be far behind the curve.
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Herb Schildt:
Ko Ko:

The feature set of Java 2, v5 is very stable at this point and I fully expect all of the code in my book to run correctly with the released version. The issues of compatibility apply to legacy code not written for version 5.

Again, I have encountered very, very few backward compatibility issues (beyond those I mentioned).

Also, if you wait for the release of version 5 before you start working with it, you will definitely be far behind the curve.


Thanks a lot for your great suggestion... That's why I started to learn Tiger, since two months ago and found it challenging to try the new things. I am glad to see that some features that are similar to C/C++ were added such as generics and enumerations...

I'm looking forward to read your book and explore the fantasy of Tiger in it...
 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm really new to java (just starting a computer science course in high school, and I studied over the summmer) and I was wondering: How much will this new version of java effect me? From what I can tell there isn't much that just simple users like myself would need.

Thanks,
Kevin
 
Ko Ko Naing
Ranch Hand
Posts: 3178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Kevin Starr:
I'm really new to java (just starting a computer science course in high school, and I studied over the summmer) and I was wondering: How much will this new version of java effect me? From what I can tell there isn't much that just simple users like myself would need.



Hi Kevin,
The new version won't affect on you that much right now. But why don't you invest some time to study them now and benefit later, when you get to work...

but if you just started to learn Java in high school course, they won't teach you about this new version and its feature for sure... But later self-study is up to you... I'm not sure your eagerness to learn new stuff...

But for now, it's beter to catch up the basis about Java first and if you got the idea or logic of programming, then go straight to this new version of Java...

Hope it helps...
 
Kevin Stock
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the advice. I am fairly interested in programming and spent the entire summer teaching myself material from the intro couse that I skipped. However, I'm not sure yet if I want to make computer science my future career.

Thanks,
Kevin
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic