Get the package name
String getName()
- Return the name of this package.
public class Main {
public static void main(String[] args) {
Package p = Package.getPackage("javax.swing");
System.out.println(p.getName());
}
}
The output:
javax.swing