Java MathContext類| hashCode()方法與示例

MathContext類的hashCode()方法 (MathContext Class hashCode() method)

  • hashCode() method is available in java.math package.

    hashCode()方法在java.math包中可用。

  • hashCode() method is used to get the hash code value of this MathContext.

    hashCode()方法用于獲取此MathContext的哈希碼值。

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

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

  • hashCode() method does not throw an exception at the time of returning hash code.

    hashCode()方法在返回哈希碼時不會引發異常。

Syntax:

句法:

    public int hashCode();

Parameter(s):

參數:

  • None

    沒有

Return value:

返回值:

The return type of this method is int, it retrieves this MathContext hash code value.

此方法的返回類型為int ,它檢索此MathContext哈希碼值。

Example:

例:

// Java program to demonstrate the example 
// of int hashCode() method of MathContext
import java.math.*;
public class HashCodeOfMC {
public static void main(String args[]) {
// Initialize three MathContext objects  
MathContext ma_co1 = new MathContext(3, RoundingMode.CEILING);
MathContext ma_co2 = new MathContext(4);
MathContext ma_co3 = new MathContext(6, RoundingMode.FLOOR);
// returns the hash code of this MathContext
// ma_co1 
int hash_code = ma_co1.hashCode();
System.out.println("ma_co1.hashCode(): " + hash_code);
// returns the hash code of this MathContext
// ma_co2 
hash_code = ma_co2.hashCode();
System.out.println("ma_co2.hashCode(): " + hash_code);
// returns the hash code of this MathContext
// ma_co3 
hash_code = ma_co3.hashCode();
System.out.println("ma_co3.hashCode(): " + hash_code);
}
}

Output

輸出量

ma_co1.hashCode(): 1420167577
ma_co2.hashCode(): 931231881
ma_co3.hashCode(): -18805464

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

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

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

相關文章

實驗8 SQL Server 的存儲過程

實驗8 SQL Server 的存儲過程一、實驗目的 1.掌握使用T-SQL編程的方法 2.掌握使用T-SQL語句創建一個存儲過程并驗證 3.掌握創建和執行帶參數的存儲過程 4.熟練使用系統存儲過程、系統函數 二、實驗要求 1.創建一個不帶參數的存儲過程。 2.創建一個帶參數的存儲過程p_count。 三…

Oracle ——如何確定性能差的 SQL

http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/TSQ7/Default.aspx 本文主要說明在應用程序內書寫和調優 SQL 語句。假設,你已經知道你應用程序中的哪些 SQL 語句需要注意。事實上,這不太容易。那么,我們如何…

C#中的委托和事件(續)

http://www.cnblogs.com/JimmyZhang/archive/2007/09/23/903360.html 歡迎瀏覽本文的后續文章: C#中的委托和事件(續)PDF 瀏覽:http://www.tracefact.net/Document/Delegates-and-Events-in-CSharp.pdf文中代碼在VS2005下通過,由于VS2003(.Ne…

Java LocalDate類| minusYears()方法與示例

LocalDate類minusYears()方法 (LocalDate Class minusYears() method) minusYears() method is available in java.time package. minusYears()方法在java.time包中可用。 minusYears() method is used to subtract the given years from this LocalDate and return the LocalD…

ffmpeg 命令添加圖片水印

使用ffplay預覽一下: ffplay -i cctvhttp.flv -vf “moviewatermark.png[watermark];[in][watermark]overlay x10:y10[out]” -x 640 -y 480 參數: 有兩個過濾器movie\overlay movie:讀取watermark.png輸出 [watermark]可以理解自定義的的變…

實驗9 SQL Server 的觸發器

實驗9 SQL Server 的觸發器一、實驗目的 1.了解觸發器的觸發過程和類型 2.通過執行SQL腳本,掌握創建觸發器并測試觸發器 3.掌握通過使用觸發器維護數據完整性的方法。 二、實驗要求 1.按指定要求創建觸發器。 三、實驗步驟 1.創建一個名為tr_age的觸發器&#xff0…

struts2學習筆記二--準備struts2的學習和開發環境

準備struts2的學習和開發環境1 導包2 參照開發包自帶的例子在web.xml文件中配置3 參照開發包自帶的例子編寫Action類和配置struts.xml文件<struts><package name"demo" namespace"/hello/word"><action name"test" class"cn…

C#實現動態桌面背景圖片切換

問題描述&#xff1a;凝視桌面背景&#xff0c;突感如果桌面背景是變化的像win7一樣&#xff0c;該多有意思啊。鬧鐘瞬間產生一個念頭&#xff0c;用C#寫一個動態切換桌面背景的圖片。如何實現這個想法了&#xff0c;我思考了一會兒&#xff0c;想到了如下的一些需要解決的問題…

duration java_Java Duration類| withSeconds()方法與示例

duration java持續時間類withSeconds()方法 (Duration Class withSeconds() method) withSeconds() method is available in java.time package. withSeconds()方法在java.time包中可用。 withSeconds() method is used to represent this Duration with the given seconds. wi…

ffmpeg 命令畫中畫效果

畫中畫效果也是和圖片水印一樣使用movie配合overlay實現 使用ffplay預覽一下&#xff1a; ffplay -i cctvhttp.flv -vf “moviecctvhttp.flv[subm];[in][subm]overlayx20:y30[o ut]” -x 640 -y 480 &#xff08;可以看到是有兩層視頻的&#xff09; 用個不同的視頻再測試&…

實驗10 SQL Server 數據備份/恢復

實驗10 SQL Server 數據備份/恢復一、實驗目的 1.了解數據庫備份的過程和屬性設置&#xff1b; 2.掌握應用企業管理器備份和恢復數據庫&#xff1b; 3.掌握應用T-SQL備份和恢復數據庫&#xff1b; 4.掌握數據導入/導出的方法。 二、實驗要求 1.創建指定數據庫的備份. 2.恢復數…

指針和數組

數組的概念與指針的概念聯系非常解密。其實數組的標識相當于它的第一個元素的地址&#xff0c;就像一個指針相當于它所指向的第一個元素的地址&#xff0c;因此其實它們是同一個東西 int numbers [20];int * p;下面的賦值為合法的&#xff1a; p numbers; 這里指針p 和numbers…

程序集(初嘗,也是為插件程序準備)

拓展名是EXE或者DLL的.net可執行程序稱為程序集。 .net程序集與一般的EXE&#xff0c;DLL的區別在于&#xff0c;它包含有metadata。 私有程序集 位于應用程序的目錄下。共享程序集 必須有一個特殊的版本號&#xff0c;唯一的名稱&#xff0c;通常安裝在全局程序集緩存&#xf…

Java BigInteger類| 帶示例的shiftLeft()方法

BigInteger類shiftLeft()方法 (BigInteger Class shiftLeft() method) shiftLeft() method is available in java.math package. shiftLeft()方法在java.math包中可用。 shiftLeft() method is used to shift the given number of bits towards the left side in this BigInteg…

匯編語言-011(無符號乘法指令MUL、有符號乘法指令IMUL、對比MUL乘法指令與SHL移位方式、符號位擴展指令,CBW,CWD,CDQ、DIV 無符號除法指令、IDIV 有符號除法指令)

1:無符號乘法指令MUL .386 .model flat,stdcall.stack 4096 ExitProcess PROTO,dwExitCode:DWORD.data val1 WORD 2000h val2 WORD 0100h .code main PROC;8位乘法mov al,5h ;被乘數mov bl,10hmul bl ;AX 0050h ,CF,OF 0;16位乘法mov ax,val1mul val2 ;DX:AX 002000…

編寫一個程序,實現將存放在AX和DX中的32位數據循環右移二進制數的4位。(DX存放高字節內容,AX存放低字節內容)

編寫一個程序&#xff0c;實現將存放在AX和DX中的32位數據循環右移二進制數的4位。&#xff08;DX存放高字節內容&#xff0c;AX存放低字節內容&#xff09; P151 例4.9 匯編思路&#xff1a; AX右移四位后&#xff0c;使用BH接收AL的低四位數據&#xff0c;得到BH的八位數據…

[轉 scrum] 大型項目開發使用敏捷是否合適?不該問的問題

原文地址&#xff1a;http://www.scrumcn.com/agiledev/html/?167.html轉載于:https://www.cnblogs.com/cly84920/archive/2010/03/17/4426844.html

匯編語言-012(擴展加法指令ADC、帶借位減法指令SBB、執行加法后進行ASCII調整指令、AAS 、AAM、AAD 、DAA指令將和數轉成壓縮十進制格式)

1:ADC : 擴展加法指令ADC .386 .model flat,stdcall.stack 4096 ExitProcess PROTO,dwExitCode:DWORD.code main PROCmov dl,0mov al,0FFhadd al,0FFh ;ALFEhadc dl,0 ;DL:AL 01FEhmov edx,0mov eax,0FFFFFFFFhadd eax,0FFFFFFFFh ;EAX FFFFFFFEhadc edx,0 …

c#中textbox屬性_C#.Net中的TextBox.Visible屬性與示例

c#中textbox屬性Here we are demonstrating use of Visible property of TextBox Control. 在這里&#xff0c;我們演示了TextBox Control的Visible屬性的使用。 Visible property contains two values 可見屬性包含兩個值 True: Using this - textbox can be visible on par…

VS2010報表

http://technet.microsoft.com/zh-cn/library/dd220516.aspx轉載于:https://www.cnblogs.com/mingyongcheng/archive/2012/09/11/2679722.html