Package java.lang
Class Package
- java.lang.Object
-
- java.lang.Package
-
- All Implemented Interfaces:
AnnotatedElement
public class Package extends Object implements AnnotatedElement
Packagerepresent a Java package.
-
-
Constructor Summary
Constructors Constructor Description Package()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetName()Return the name of this package.inthashCode()Return the hash code computed from the package name.StringtoString()Returns the string representation of this Package.
-
-
-
Method Detail
-
getName
public String getName()
Return the name of this package.- Returns:
- The fully-qualified name of this package as defined in section 6.5.3 of The
Java™ Language Specification, for example,
java.lang
-
hashCode
public int hashCode()
Return the hash code computed from the package name.- Overrides:
hashCodein classObject- Returns:
- the hash code computed from the package name.
- See Also:
Object.equals(java.lang.Object),System.identityHashCode(java.lang.Object)
-
toString
public String toString()
Returns the string representation of this Package. Its value is the string "package " and the package name. If the package title is defined it is appended. If the package version is defined it is appended.
-
-