Javatpoint Logo
Javatpoint Logo

Java Class getPackage() Method

The getPackage() method of java Class class returns the package name of the class.

Syntax

Parameter

NA

Returns

The int representing the modifiers for this class.

Throws

The package of this class.

Example 1

Test it Now

Output:

Class ::: java.lang.Integer
Package ::: package java.lang, Java Platform API Specification, version 1.8

Example 2

Test it Now

Output:

Class
java.util

Next TopicJava Class





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA