Package getImplementationVersion() Method

Advertisements


Description

The java.lang.Package.getImplementationVersion() method returns the version of this implementation. It consists of any string assigned by the vendor of this implementation and does not have any particular syntax specified or expected by the Java runtime. It may be compared for equality with other package version strings used for this implementation by this vendor for this package.

Declaration

Following is the declaration for java.lang.Package.getImplementationVersion() method

public String getImplementationVersion()

Parameters

  • NA

Return Value

This method returns the version of the implementation, null is returned if it is not known.

Exception

  • NA

Example

The following example shows the usage of lang.Object.getImplementationVersion() method.

package com.tutorialspoint;

public class PackageDemo {

   public static void main(String[] args) {

      // create a package object for java.lang package
      Package pack = Package.getPackage("java.lang");

      // get the implementation version
      System.out.println("" + pack.getImplementationVersion());
   }
}

Let us compile and run the above program, this will produce the following result:

1.6.0_25



Advertisements
Advertisements