• Advertisement

Archived

This topic is now archived and is closed to further replies.

[java] JSR 201 (Language Enhancements in Java 1.5)

This topic is 5619 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

Well, it looks like in addition to generics we''re going to get some more goodies with 1.5: type-safe enumerations, autoboxing of primitives, for each loops, and static imports. The JSR is here.

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by WayfarerX
type-safe enumerations, autoboxing of primitives, for each loops

Those features look familiar...



For those who believe in God, most of the big questions are answered. But for those of us who can''t readily accept the God formula, the big answers don''t remain stone- written. We adjust to new conditions and discoveries. We are pliable. Love need not be a command or faith a dictum. I am my own God. We are here to unlearn the teachings of the church, state, and our educational system. We are here to drink beer. We are here to kill war. We are here to laugh at the odds and live our lives so well that Death will tremble to take us -- Charles Bukowski

Share this post


Link to post
Share on other sites
Enumerations and autoboxing yeah! The rest boo. I hope Sun doesn''t start turning java into msvc because of dotnet.

"... we should have such an empire for liberty as she has never surveyed since the creation ..."
Thomas Jefferson

Share this post


Link to post
Share on other sites
quote:
Those features look familiar...

The motivations for implementing at least two of the features are different though than for having them in C#. Autoboxing is needed to support primitives in the generics proposal that will also be included in the Tiger release and the trickiness of using the type-safe enum pattern in an environment with serialization and dynamic class loading through multiple class loaders makes it a real safety hazard for enterprise development and needs to be fixed.


[edited by - HenryAPe on December 5, 2002 1:16:11 AM]

Share this post


Link to post
Share on other sites
quote:
Original post by GKW
The rest boo.

What''s wrong with foreach? Do you really enjoy writing the same boilerplate collection iterator code over and over again?

Share this post


Link to post
Share on other sites
col = somecollection
while( col.hasnext() ) {
yada;
}

Man that killed me. I just don''t want them to start including all sorts of shortcuts that muddy up the language. Nothing personal against foreach, I will probably use it, I just hope they don''t go too far down that road. Personally I can''t wait for all the new garbage collection facilities they are supposed to include in tiger.

"... we should have such an empire for liberty as she has never surveyed since the creation ..."
Thomas Jefferson

Share this post


Link to post
Share on other sites
Actually it's:

Iterator iter = coll.iterator();
while (iter.hasNext()) {
MyObject obj = (MyObject)iter.next();
// yada
}

Which will become something like:

for (MyObject obj : coll) {
// yada
}

I like it because I don't have to explicitly declare temporary variables or deal with the semantics of Iterator.

However, I am a little leery of the static imports. I've always liked how Java forced partitioning of the global namespace.

[edited by - wayfarerx on December 5, 2002 12:29:26 PM]

Share this post


Link to post
Share on other sites
Excuse my ignorance, but what is tiger? Is it a whole new language or is it like OS X 10.2 being called jaguar?

***********************
          

Share this post


Link to post
Share on other sites

  • Advertisement