commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Al Chou <>
Subject [math] J2SE 1.5 static import of methods
Date Fri, 06 Feb 2004 14:41:04 GMT
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

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


Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message