Java.lang Package Classes

Java.lang.Package Class

Java Package Class

Java.lang package provides a Package class which contains version information about the implementation and specification of a Java package.

Class declaration

The declaration of java.lang.Package class is:

public class Package
  extends Object
    implements AnnotatedElement

java.lang.Package Methods

The java.lang.Package class has a number of methods which are listed below:

Member Methods

S.NMethods & Description
1. String getName()
Return the name of this package.
2. String getImplementationTitle()
Return the title of this package.
3. String getImplementationVendor()
Returns the name of the organization, vendor or company that provided this implementation.
4. String getImplementationVersion()
Return the version of this implementation.
5. static Package getPackage(String name)
Find a package by name in the callers ClassLoader instance.
6. static Package[] getPackages()
Get all the packages currently known for the caller's ClassLoader instance.
7. String getSpecificationTitle()
Return the title of the specification that this package implements.
8. String getSpecificationVendor()
Return the name of the organization, vendor, or company that owns and maintains the specification of the classes that implement this package.
9. String getSpecificationVersion()
Returns the version number of the specification that this package implements.
10. int hashCode()
Return the hash code computed from the package name.
11. boolean isCompatibleWith(String desired)
Compare this package's specification version with a desired version.
12. boolean isSealed()
Returns true if this package is sealed.
13. String toString()
Returns the string representation of this Package.

Methods inherited

This class inherits the methods of following class:

  • java.lang.Object