
Java
shiwenbo1994
这个作者很懒,什么都没留下…
展开
-
String传值问题
今天写了一个bug:在一个函数中对传进来的String类型参数进行修改,可输出的String值未修改。 类似的: public static void main(String[] args) { String str = "aa"; Test1 test = new Test1(); test.change(str); S...原创 2019-08-26 16:09:06 · 1254 阅读 · 0 评论 -
String类 intern()方法笔记
jdk8下的intern()方法public final class String { /**返回字符串对象的规范表示形式 * 字符串常量池初始为空,被String类私有地维护。 * 如果当intern方法调用时,池中早已经有了与方法中的String对象相等(equals)的字符串值,那么返回池中的字符串。 * 否则,这个String对象加入到池中,并且返回该String对象的引用 *...原创 2019-09-05 23:22:16 · 143 阅读 · 0 评论 -
System.identityHashCode()方法
/** * Returns the same hash code for the given object as * would be returned by the default method hashCode(), * whether or not the given object's class overrides * hashCode()....原创 2019-09-22 18:58:33 · 5762 阅读 · 0 评论