Package.getSpecificationVersion() has the following syntax.
public String getSpecificationVersion()
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.