java jar包示例_Java包isCompatibleWith()方法與示例

java jar包示例

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

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

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

  • isCompatibleWith() method is used to check the specification version of this package with the specification version of the desired or given package.

    isCompatibleWith()方法用于檢查此程序包的規范版本與所需或給定程序包的規范版本。

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

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

  • isCompatibleWith() method may throw an exception at the time of comprising the package specification version.

    在包含程序包規范版本時, isCompatibleWith()方法可能會引發異常。

    NumberFormatException: In this exception, when the desired package specification version or current package specification version is not in the correct format.

    NumberFormatException :在此異常中,當所需的軟件包說明版本或當前軟件包說明版本的格式不正確時。

Syntax:

句法:

    public boolean isCompatibleWith(String des_pck_ver);

Parameter(s):

參數:

  • String des_pck_ver – represents the specification version of the desired package.

    字符串des_pck_ver –表示所需軟件包的規范版本。

Return value:

返回值:

The return type of this method is boolean, it returns the following values based on the given cases,

此方法的返回類型為boolean ,它根據給定的情況返回以下值:

  • It returns true when this package specification version value is equal to or greater than the specification version of the desired package.

    當此程序包規范版本值等于或大于所需程序包的規范版本時,它返回true 。

  • It returns false when this package specification version value is less than the specification version of the desired package.

    當此軟件包規范版本值小于所需軟件包的規范版本時,它返回false 。

Example:

例:

// Java program to demonstrate the example 
// of boolean isCompatibleWith(String des_pck_ver)
// method of Package 
public class IsCompatibleWith {
public static void main(String[] args) {
// Get Package by using getPackage() method
Package pkg = Package.getPackage("java.util");
// By using isCompatibleWith(pkg_ver) method is to check 
// version compatibility of this package with the given version
boolean pck_ver = pkg.isCompatibleWith("1.4.7");
// Display compatibility of the package
System.out.println("pkg.isCompatibleWith(1.4.7) = " + pck_ver);
}
}

Output

輸出量

pkg.isCompatibleWith(1.4.7) = false

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

java jar包示例

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/379386.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/379386.shtml
英文地址,請注明出處:http://en.pswp.cn/news/379386.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

面向對象的JavaScript編程

Javascript對于做過Web程序的人不應該是陌生,初期是用來做一些簡單的FORM驗證,基本上是在玩弄一些技巧性的東西。IE 4.0引入了DHTML,同時為了對抗Netscape的Javascript,提出了自己的腳本語言JScript,除了遵循EMAC的標準之外&#…

實驗3 SQL Server 表中記錄更新操作

實驗3 SQL Server 表中記錄更新操作一、實驗目的 1.掌握INSERT INTO語句的方法。 2.了解INSERT FROM語句的方法。 3.掌握UPDATE語句的方法。 4.掌握DELETE語句的方法。 二、實驗要求 1.在已經創建好的eshop數據庫中的各表中添加樣例數據。 三、實驗步驟 1.在eshop數據庫的memb…

HTML 5 標簽

HTML 5 <nav> 標簽 定義和用法 <nav> 標簽定義導航鏈接的部分。 實例 <nav> <a href"index.asp">Home</a> <a href"html5_meter.asp">Previous</a> <a href"html5_noscript.asp">Next</a>…

Assert和異常處理

Assert用于檢查不應該發生情況&#xff0c;用來幫助開發人員對問題的快速定位。異常處理用于對程序發生異常情況的處理&#xff0c;增強程序的健壯性、容錯性&#xff0c;減少程序使用中對用戶不有好的行為&#xff0c;不讓(通常也不必)用戶知道發生了什么錯誤。實際開發中&…

tooctalstring_Java Long類toOctalString()方法的示例

tooctalstring長類toOctalString()方法 (Long class toOctalString() method) toOctalString() method is available in java.lang package. toOctalString()方法在java.lang包中可用。 toOctalString() method is used to represent an octal string of the given parameter […

匯編語言-009(表驅動選擇 、條件控制流偽指令 、邏輯移位SHL,SHR 算術移位SAL,SAR)

1&#xff1a; 表驅動選擇&#xff0c;用查表來代替多路選擇結構的一種方法 .386 .model flat,stdcallinclude Irvine32.inc.stack 4096 ExitProcess PROTO,dwExitCode:DWORD.data CaseTable BYTE A ;查詢值DWORD Process_A ;過程地址 EntrySize ($ - CaseT…

如何解決EDM郵件營銷中的圖片難題

隨著互聯網的高速發展&#xff0c;已然進入到了讀圖時代&#xff0c;EDM郵件營銷尤為注重圖片的運用。純文本的郵件太枯燥&#xff0c;巧借圖片&#xff0c;可以提高內容的可讀性&#xff0c;吸引用戶注意力。然而&#xff0c;我們卻常常不得不面對這樣的尷尬&#xff1a;打開郵…

實驗2 SQL Server 表操作

實驗2 SQL Server 表操作一、實驗目的 1.了解表設計和表結構相關知識。 2.掌握管理工具創建、修改、查看和刪除表的方法。 3.掌握T-SQL語句創建、修改、查看和刪除表的方法。 4.了解表和數據庫的關系。 二、實驗要求 1.創建好的“網上購物系統”數據庫eshop中的members表、pro…

深入理解.net的事件與委托機制

首先介紹一個為什么要在事件中引入委托這個概念&#xff1a;  事件是對象發送的消息&#xff0c;以發信號通知操作的發生。操作可能是由用戶交互&#xff08;例如鼠標單擊&#xff09;引起的&#xff0c;也可能是由某些其他的程序邏輯觸發的。引發事件的對象稱為事件發送方。…

Java ObjectOutputStream flush()方法與示例

ObjectOutputStream類flush()方法 (ObjectOutputStream Class flush() method) flush() method is available in java.io package. flush()方法在java.io包中可用。 flush() method is used to flush this stream and write bytes immediately of any buffered output to the u…

ffmpeg 命令裁剪合并

1 mp4格式&#xff1a; 裁剪從一個視頻中的1分鐘、2分鐘、3分鐘開始截取10秒 ffmpeg -i test_1280x720.mp4 -ss 00:01:00 -t 10 -codec copy copy1.mp4 ffmpeg -i test_1280x720.mp4 -ss 00:02:00 -t 10 -codec copy copy2.mp4 ffmpeg -i test_1280x720.mp4 -ss 00:03:00 -t 10…

Struts2初始化流程及源碼分析

1.1 Struts2初始化 在講Struts2的初始化之前&#xff0c;應該為大家描述下Web應用中的過濾器Filter&#xff0c;這關系到我們對核心過濾器FilterDispatcher的正確理解。 Filter&#xff1a;一個filter是一個對象&#xff0c;為每個請求資源(一個servlet或靜態內容) &#xff0c…

實驗1 數據庫操作

實驗1 數據庫操作一、實驗目的 1.掌握管理工具、T-SQL創建數據庫的方法。 2.掌握管理工具、T-SQL修改和查看數據庫的方法。 3.掌握管理工具、T-SQL刪除數據庫的方法。 4.掌握數據庫的附加與分離 二、實驗要求 1.創建實驗所用到的“網上購物系統”數據庫eshop。 三、實驗內容 1…

Java FileInputStream finalize()方法與示例

FileInputStream類的finalize()方法 (FileInputStream Class finalize() method) finalize() method is available in java.io package. finalize()方法在java.io包中可用。 finalize() method is used to assure that close() method of this FileInputStream invokes when th…

逆風飛揚,吳仁宏

摘自逆風飛揚,吳仁宏自傳 它是一個從"生而自卑"到"個性飛揚"的故事&#xff0c;當然具有傳奇色彩 中國人幾千年都不是天生的贏家&#xff0c;讓我們努力&#xff0c;為國為家為自己&#xff0c;做贏家&#xff01; 生存哲學 尼采 痛苦,挫折使生命遷長,使人…

ffmpeg 命令圖片和視頻相互轉換

1當前文件環境&#xff1a; ffmpeg -i test.mp4 -y -f image2 -ss 00:00:02 -vframes 1 -s 640x360 test.jpg ffmpeg -i test.mp4 -y -f image2 -ss 00:00:02 -vframes 1 -s 640x360 test.bmp 使用ffplay test.jpb ffplay test.bmp 都是可以打開的 參數介紹&#xff1a; -y 如…

如何點擊鏈接直接跳轉到app store指定應用下載頁面

轉載自&#xff1a;http://blog.csdn.net/zengconggen/article/details/6789420 NSString *str [NSString stringWithFormat:"http://itunes.apple.com/us/app/id%d", 436957167]; [[UIApplication sharedApplication] openURL:[NSURL urlWithString:str]];其中&…

COLLEGE.sql(復制的時候注意路徑!!!)

USE [master] GO /****** Object: Database [COLLEGE] Script Date: 2019/11/25 星期一 上午 08:57:11 / CREATE DATABASE [COLLEGE] ON PRIMARY ( NAME N’COLLEGE_m’, FILENAME N’F:\COLLEGE\COLLEGE.mdf’ , SIZE 51200KB , MAXSIZE UNLIMITED, FILEGROWTH 10240KB )…

【管理】「本能叛逆」與「理性叛逆」

叛逆是一般人認知的負面名詞&#xff0c;但是&#xff0c;很多人都忽略掉&#xff0c;它卻是人類進步的重要因子。觀察孩童的成長過程&#xff0c;十歲以后都會出現叛逆行為&#xff0c;相當令父母及師長頭痛。然而&#xff0c;叛逆卻是促使孩童突破家庭單一環境養成的認知與觀…

Java Double類parseDouble()方法的示例

Double類parseDouble()方法 (Double class parseDouble() method) parseDouble() method is available in java.lang package. parseDouble()方法在java.lang包中可用。 parseDouble() method is used to return the double value corresponding to the given String or in oth…