![]() |
![]() |
Static Import with Java Tiger (J2SE 5.0)In Java 5.0 you will be able to refer to static constants from a class without having to inherit from it.Prior to Java Tiger, you would need to call code thus: import java.awt.BorderLayout.*; getContentPane().add(new JPanel(), BorderLayout.CENTER);Now you can abreviate the code thus: import static java.awt.BorderLayout.*; getContentPane().add(new JPanel(), CENTER); Further reading...For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest. Other websites on Java Tiger can be found at Links-for-Java. |