Objects by Design Forums Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home  
Objects by Design Forums : Powered by vBulletin version 2.3.5 Objects by Design Forums > Main Forums > Object-Oriented Software Environments > JSR 201 - Java Language enhancements
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
sduskis
Member

Registered: Apr 2001
Location: Monsey, NY
Posts: 33

JSR 201 - Java Language enhancements

JSR 201
Extending the JavaTM Programming Language with Enumerations, Autoboxing, Enhanced for loops and Static Import

http://jcp.org/en/jsr/detail?id=201


enumerations:
These are just like C++ enums:

quote:
public enum Suit { clubs, diamonds, hearts, spades }


Until this JSR, the only "clean" way to do this was to create your own class with static variables and private constructors.


autoboxing:
This is a feature of C#. Supposedly named after prominent Microsoft guru Don Box. You will be allowed to do things like:
quote:
1.toString();
list.add(1);



Enhancements for loops:

quote:
for (Iterator i = c.iterator(); i.hasNext(); ) { // No ForUpdate
String s = (String) i.next();
...
}


Becomes (with generics):
quote:
for (String s : c) {
...
}



Static imports:

quote:
Math.sin(x);
Math.cos(x);



Becomes:

quote:
import static java.util.Math.*;

...
sin(x);
cos(x);

Report this post to a moderator | IP: Logged

Old Post 12-05-2002 01:14 PM
sduskis is offline Click Here to See the Profile for sduskis Click here to Send sduskis a Private Message Find more posts by sduskis Add sduskis to your buddy list Edit/Delete Message Reply w/Quote
SZ
Administrator

Registered: Apr 2001
Location: New York
Posts: 492

more information on generics

I found a good description of generics on java.sun.com. It looks like C++ templates finally made it to Java!

Report this post to a moderator | IP: Logged

Old Post 12-11-2002 01:09 AM
SZ is offline Click Here to See the Profile for SZ Click here to Send SZ a Private Message Visit SZ's homepage! Find more posts by SZ Add SZ to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 11:16 AM. Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

< Contact Us - Objects by Design >

Powered by: vBulletin Version 2.3.5
Copyright ©2000 - 2018, Jelsoft Enterprises Limited.
Copyright 1999-2005, Objects by Design, Inc.