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.

-- Rogers Cadenhead

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.