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 {
/* w w w. ja v a 2 s. co 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.