Get the package name

ReturnMethodSummary
StringgetName()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
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.