Workbench: Programming, Publishing, Politics, and Popes

Subscriptions

Menu

Working On

World Readable

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

Russell Brand's rock star in 'Forgetting Sarah Marshall' needs his own movie. 3 days ago






Home | Comments | Books | Code | RSS Feed | RSS Spec | Copyright 2008 World Readable