Java Data Type Tutorial - Java Package .getSpecificationVersion ()








Syntax

Package.getSpecificationVersion() has the following syntax.

public String getSpecificationVersion()

Example

In the following code shows how to use Package.getSpecificationVersion() method.

public class Main {
/* www  .j a  v a2  s  . c  o  m*/
   public static void main(String[] args) {

      // get the java lang package
      Package pack = Package.getPackage("java.lang");

      // print the specification version for this package
      System.out.println(pack.getSpecificationVersion());

   }
}

The code above generates the following result.