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.





















Home »
  Java Tutorial »
    java.lang »




Boolean
Byte
Character
Class
Double
Enum
Float
Integer
Long
Math
Number
Object
Package
Process
ProcessBuilder
Runnable
Runtime
SecurityManager
Short
StackTraceElement
StrictMath
String
StringBuffer
StringBuilder
System
Thread
ThreadGroup
ThreadLocal
Throwable