java jar包示例
包类的getSpecificationVendor()方法 (Package Class getSpecificationVendor() method)
getSpecificationVendor() method is available in java.lang package.
getSpecificationVendor()方法在java.lang包中可用。
getSpecificationVendor() method is used to retrieve the name of the vendor that manages the specification of the classes or interface that is implemented by this package.
getSpecificationVendor()方法用于检索管理由此程序包实现的类或接口的规范的供应商的名称。
getSpecificationVendor() method is a non-static method, it is accessible with the class object only and if we try to access the method with the class name then we will get an error.
getSpecificationVendor()方法是一个非静态方法,只能通过类对象访问,如果尝试使用类名称访问该方法,则会收到错误消息。
getSpecificationVendor() method does not throw an exception at the time of returning specification vendor of the package.
返回包的规范供应商时, getSpecificationVendor()方法不会引发异常。
Syntax:
句法:
public String getSpecificationVendor();
Parameter(s):
参数:
It does not accept any parameter.
它不接受任何参数。
Return value:
返回值:
The return type of this method is String, it returns the name of the company who specializes in this package otherwise it returns null when specification vendor of the package is not known.
此方法的返回类型为String ,它返回专门从事此程序包的公司的名称,否则,当未知程序包的供应商时返回null。
Example:
例:
// Java program to demonstrate the example
// of String getSpecificationVendor() of Package method
public class GetSpecificationVendor {
public static void main(String[] args) {
// Get Package by using getPackage() method
Package pkg = Package.getPackage("java.util");
// Get specification vendor of the package by using
// getSpecificationVendor() and stored in a variable
// called svendor
String svendor = pkg.getSpecificationVendor();
// Display vendor of the package
System.out.print("Package Vendor: ");
System.out.print(svendor);
}
}
Output
输出量
Package Vendor: Sun Microsystems, Inc.
翻译自: https://www.includehelp.com/java/package-getspecificationvendor-method-with-example.aspx
java jar包示例