日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

java jar包示例_Java包getSpecificationVersion()方法和示例

發布時間:2025/3/11 65 豆豆
生活随笔 收集整理的這篇文章主要介紹了 java jar包示例_Java包getSpecificationVersion()方法和示例 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

java jar包示例

包類的getSpecificationVersion()方法 (Package Class getSpecificationVersion() method)

  • getSpecificationVersion() method is available in java.lang package.

    getSpecificationVersion()方法在java.lang包中可用。

  • getSpecificationVersion() method is used to retrieve the specification version of the package that this package implements and the version is a sequence of no negative decimal integer and is separated by "." and may have leading zeros.

    getSpecificationVersion()方法用于檢索此程序包實現的程序包的規范版本,該版本是無負十進制整數的序列,并用“。”分隔。 并可能有前導零。

  • getSpecificationVersion() 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.

    getSpecificationVersion()方法是一種非靜態方法,只能通過類對象訪問,如果嘗試使用類名稱訪問該方法,則會收到錯誤消息。

  • getSpecificationVersion() method does not throw an exception at the time of returning the specification version of the package.

    返回包的規范版本時, getSpecificationVersion()方法不會引發異常。

Syntax:

句法:

public String getSpecificationVersion();

Parameter(s):

參數:

  • It does not accept any parameter.

    它不接受任何參數。

Return value:

返回值:

The return type of this method is String, it returns the version of the specification that this package implements otherwise it returns null when specification version of the package is not known.

此方法的返回類型為String ,它返回此程序包實現的規范的版本,否則,當未知程序包的規范版本時,它返回null。

Example:

例:

// Java program to demonstrate the example // of String getSpecificationVersion() // of Package methodpublic class GetSpecificationVersion {public static void main(String[] args) {// Get Package by using getPackage() methodPackage pkg = Package.getPackage("java.util");// Get specification version of the package by using // getSpecificationVersion() and stored in a variable// called sversionString sversion = pkg.getSpecificationVersion();// Display version of the packageSystem.out.print("Package Version: ");System.out.print(sversion);} }

Output

輸出量

Package Version: 1.4

翻譯自: https://www.includehelp.com/java/package-getspecificationversion-method-with-example.aspx

java jar包示例

總結

以上是生活随笔為你收集整理的java jar包示例_Java包getSpecificationVersion()方法和示例的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。