- 博客(4)
- 收藏
- 关注
原创 String的特点
判断以下代码的输出结果: String str = new String("good"); char[] ch = {'a','b','c'}; public static void main(String[] args) { Example example = new Example(); example.change(example.str, example.ch); System.out.print(example.str+"and")
2021-08-04 17:26:50
122
原创 类加载顺序
分别求这两段代码的输出结果: class C { C() { System.out.print("C"); } } class A { C c = new C(); A() { this("A"); System.out.print("A"); } A(String s) { System.out.print(s); } } class Test extends A { T
2021-08-04 15:47:49
106
原创 字符串数字是否相等所蕴含的底层原理!
字符串数字是否相等所蕴含的底层原理! 思考 `String s1 = "a"; String s2 `="b"; String s3 = "ab"; String s4 = s1 + s2 System.out.println(s3==s4); 请问输出的是ture,还是false,说说为什么 想要知道这个问题我们首先得先看看字符串在内存中到底是怎样存储的 我们编写这个代码编译后使用JAVAP -V 指令来看看虚拟机对于整个程序到底是如何执行的 我们主要关注以下这两部分: 我们可以看到图一最关键的信息
2021-06-04 20:59:14
251
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅