Java.lang.Package.getSpecificationTitle() Method


Advertisements


Description

The java.lang.Package.getSpecificationTitle() method returns the title of the specification that this package implements.

Declaration

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

public String getSpecificationTitle()

Parameters

NA

Return Value

This method returns the specification title, null is returned if it is not known.

Exception

NA

Example

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

package com.tutorialspoint;

public class PackageDemo {

   public static void main(String[] args) {

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

      // print the specification title for this package
      System.out.println("" + pack.getSpecificationTitle());
   }
}

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

Java Platform API Specification

java_lang_package.htm

Advertisements