java.lang.instrument ASSERTION FAILED ***: "error == JVMTI_ERROR_NONE" at Reentrancy.c line: 161
来源:互联网 发布:单片机数码管接线 编辑:程序博客网 时间:2024/05/29 14:02
今天在学习System类的identityHashCode()时,写了如下程序,但遇到了如题所示的错误。
该程序主要是比较String类建立对象的不同方式的区别,以及identityHashCode()方法和重写的hashCode()方法的区别,具体程序如下。
package com.iris.demo;public class IdentityHashCodeTest { public static void main(String[] args) { //下面程序中的s1和s2是两个不同的对象 String s1=new String("Hello"); String s2=new String("Hello"); //String重写了hashCode()方法,改为根据字符序列计算hashCode()值 //因为s1和s2的字符序列相同,所以它们的HashCode值相同 System.out.println(s1.hashCode()+"---"+s2.hashCode()); //s1和s2是不同的字符串对象,所以它们的identityHashCode值不同 System.out.println(System.identityHashCode(s1)+"---"+System.identityHashCode(s2)); String s3="java"; String s4="java"; //s3和s4是相同的字符串对象,所以它们的identityHashCode值相同 System.out.println(System.identityHashCode(s3)+"---"+System.identityHashCode(s4)); System.out.println(s3.equals(s4)); }}
运行结果如图所示,第一次运行正常,第二次就出现了如下红色部分,再运行也是好的,说明是偶然事件。。。目前还不直到什么意思,先记录一下。
阅读全文
1 0
- java.lang.instrument ASSERTION FAILED ***: "error == JVMTI_ERROR_NONE" at Reentrancy.c line: 161
- 内存溢出:*** java.lang.instrument ASSERTION FAILED ***
- gedit assertion `lang != NULL' failed
- Assertion "OSQCreate" failed at line 71 in ..\LWIP\arch\sys_arch.c错误解决方法
- Debug Assertion Failed! File: isctype.c Line: 56 Expression (unsigned) (c+1) <=256
- OpenCV Error: Assertion failed (s >= 0)
- debug assertion failed dbgheap.c line:1044 问题解决
- debug assertion failed dbgheap.c line:1044 问题解决
- 解决错误:Assertion failed: hunk, file patch.c, line 321
- Debug Assertion Failed line:2553
- debug assertion failed line 40
- OpenCV Error: Assertion failed
- OpenCV Error:Assertion failed ...
- OpenCV Error: Assertion failed
- Package java.lang.instrument
- Pro*C/C++ 预编译出现“ INTERNAL ERROR: Failed assertion [PGE Code=90105] ”错误的原因及解决方法。
- Assertion failed: xdrPtr && xdrPtr == *xdrLPP, file xx.cpp, line 2233
- C 运行错误:debug assertion failed,stream!=null
- LAMP之CentOS5_JDK安装
- Python 添加windows server服务程序
- Reverse String
- Elasticsearch 集群优化总结
- ImageLoader怎么用
- java.lang.instrument ASSERTION FAILED ***: "error == JVMTI_ERROR_NONE" at Reentrancy.c line: 161
- loadrunner可以使用非IE浏览器进行录制脚本
- 51Nod
- Android中常用的驼峰式命名
- JQuery判断radio(单选框)是否选中和获取选中值方法总结
- cas 单点登录修改认证方式 jeesite
- 算法总结
- JVM中的直接引用和符号引用
- XListView(下拉刷新上来加载)