Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

34.Package Class By Mr.

Vishnu

Package class in java

Package class:

Package class provides the information about a package like package name,
implementation title etc.

Example:

packagecom.sst;

//This class is used to show use of Package class.


public class Test {
public static void main(String args[]) {
Package package1 = Package.getPackage("java.lang");
System.out.println("package name = " + package1.getName());
System.out.println("Specification Title = "
+ package1.getSpecificationTitle());
System.out.println("Specification Vendor = "
+ package1.getSpecificationVendor());
System.out.println("Specification Version = "
+ package1.getSpecificationVersion());
System.out.println("Implementaion Title = "
+ package1.getImplementationTitle());
}

Output:

package name = java.lang


Specification Title = Java Platform API Specification
Specification Vendor = Sun Microsystems, Inc.
Specification Version = 1.6
Implementaion Title = Java Runtime Environment

Sri Sureka Technologies, Opposite Geethanjali High School, Near S.R.Nagar Signal, S.R.Nagar,
Hyderabad-500038, Ph: 040-66616677, Mobile: +91-9885602332.

You might also like