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

Java MathContext类| hashCode()方法与示例相关推荐

  1. java annotation class,Java Class类 isAnnotation()方法及示例

    Class类isAnnotation()方法isAnnotation()方法在java.lang包中可用. isAnnotation()方法用于检查此Class对象是否表示注释类型. isAnnota ...

  2. java字符类型的返回值,Java字符类isWhitespace()方法及示例

    Character 类isWhitespace()法isWhitespace()方法在java.lang包中可用. isWhitespace()方法用于检查给定的char值是否为空格,但是它包含空格中 ...

  3. Java Short类hashCode()方法及示例

    短类hashCode()方法 (Short class hashCode() method) hashCode() method is available in java.lang package. ...

  4. Java Double类hashCode()方法及示例

    双类hashCode()方法 (Double class hashCode() method) hashCode() method is available in java.lang package. ...

  5. Java即时类| hashCode()方法与示例

    即时类hashCode()方法 (Instant Class hashCode() method) hashCode() method is available in java.time packag ...

  6. Java BigInteger类| hashCode()方法与示例

    BigInteger类hashCode()方法 (BigInteger Class hashCode() method) hashCode() method is available in java. ...

  7. java日历类add方法_Java日历computeTime()方法及示例

    java日历类add方法 日历类computeTime()方法 (Calendar Class computeTime() method) computeTime() method is availa ...

  8. java日历类add方法_Java日历computeFields()方法及示例

    java日历类add方法 日历类的computeFields()方法 (Calendar Class computeFields() method) computeFields() method is ...

  9. java日历类add方法_Java日历setFirstDayOfWeek()方法与示例

    java日历类add方法 日历类setFirstDayOfWeek()方法 (Calendar Class setFirstDayOfWeek() method) setFirstDayOfWeek( ...

最新文章

  1. 澳大利亚多地热浪来袭 最高温度超40摄氏度
  2. Kotlin的解析(中)
  3. 笔记-项目采购管理-索赔的处理
  4. vivado 综合报错 “ incorrect freePtr. Call out of sequence? “
  5. Libevent源码分析
  6. 漫步数学分析三十一——矩阵表示
  7. 《Python游戏趣味编程》 第7章 飞机大战
  8. 5个相见恨晚的Linux命令
  9. 哈哈,我把熊猫烧香病毒扒了!
  10. w10恢复出厂设置_笔记本电脑w10怎么恢复出厂设置
  11. CleanMyMac X苹果电脑系统管家级的多功能百宝箱
  12. Android 10.0在电话拨号盘(Dialer app中)通过暗码进入工厂测试模式
  13. 机器学习实战(五) kaggle练习赛 泰坦尼克获救预测
  14. 用c语言写一个简单的名人名言播放器
  15. 问题解答:No active profile set, falling back to default profiles: default
  16. Java面试题交流群
  17. matlab画三维图如何更改颜色,matlab画三维图像的示例代码(附demo)
  18. Windows服务应用程序
  19. 华为p50鸿蒙系统手机价格,华为P50系列屏幕、镜头、芯片、价格全曝光,预装鸿蒙系统?...
  20. g711原理pcm转alaw,pcm转ulaw,alaw转pcm,ulaw转pcm

热门文章

  1. orchard mysql_如何在Orchard CMS 1.3.10中使用MySQL数据库?
  2. 【canvas系列】canvas实现“ 简单的Amaziograph效果”--画对称图【强迫症福利】
  3. 手机端input[type=date]的placeholder不起作用
  4. JavaScript中不得不说的断言?
  5. node.js中exports与module.exports的区别分析
  6. jQuary总结11:jQuery插件封装---jQuery封装 手风琴 动画插件
  7. jquery-文档操作
  8. Java Mybatis
  9. angular js实现开关效果
  10. 12日疯人认证百度云_12月15日上海实习汇总(百度、美图、哔哩哔哩等)