Workbench: Programming, Publishing, Politics, and Popes

Subscriptions

Menu

Working On

Miscellany

Technorati

XFN Friendly

Java 1.5's quirky new static import

David Flanagan has been experimenting with the new static import feature in Java 2 version 1.5, which provides a shorthand way to refer to class variables:

import static java.lang.System.out;

class SalutonMondo {
public static void main(String[] args) {
out.println("Saluton Mondo!");
}
}

That seems simple enough, but as Flanagan demonstrates, the static import keyword does some things you might not expect.

Comments

Add a Comment

These HTML tags are permitted: p, b, i, a, and blockquote. A comment may not include more than three links. Participants in this discussion should note the site's moderation policy.

:
:
:

Twitter

How is it even possible to spend $3,000 a month on online porn? The repetitive motion stress would be enormous. about 13 hours ago