You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by Al Chou <ho...@yahoo.com> on 2004/02/06 15:41:04 UTC

[math] J2SE 1.5 static import of methods

Maybe you all know about this feature of the just-beta Java 1.5, but I was
pleasantly surprised to learn on slide 46 of the presentation below

http://www.javasig.com/Archive/lectures/JavaSIG-Tiger.pdf

that the new static import feature allows you to write things like

import static Math;
x = cos(PI * theta);

instead of

x = Math.cos(Math.PI * theta);

(Note that not only does "PI" not need to be qualified by "Math.", neither does
the "cos" call.)

It'll be nice when the day comes that we can actually use this feature as the
default....


Al

__________________________________
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.
http://taxes.yahoo.com/filing.html

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [math] J2SE 1.5 static import of methods

Posted by Michael Heuer <he...@acm.org>.
On Fri, 6 Feb 2004, __matthewHawthorne wrote:

> Al Chou wrote:
> > It'll be nice when the day comes that we can actually use this feature as the
> > default....
>
> Yeah, really.  It's unfortunate that so many vendors and corporations
> lag behind the latest Java versions.  There are so many cool new
> features in 1.5, and some good new classes also.

That doesn't mean that development can't go on with the latest and
greatest -- that's what experimental branches in CVS are for.

   michael


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Re: [math] J2SE 1.5 static import of methods

Posted by __matthewHawthorne <ma...@apache.org>.
Al Chou wrote:
> It'll be nice when the day comes that we can actually use this feature as the
> default....


Yeah, really.  It's unfortunate that so many vendors and corporations 
lag behind the latest Java versions.  There are so many cool new 
features in 1.5, and some good new classes also.



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org