Java tutorial
/* * Output: */ public class MainClass { public static void main(String[] args) { Package p = Package.getPackage("javax.swing"); System.out.print("Swing Version: "); System.out.println(p.getSpecificationVersion()); p = Package.getPackage("java.awt"); System.out.print("AWT Version: "); System.out.println(p.getSpecificationVersion()); } }