上一页 1 ··· 14 15 16 17 18
摘要: (1)通过StringBuilder的reverse()方法,速度最快: 1 public class StringReverse { 2 public static void main(String[] args) { 3 String str="hello"; 4 System.out.prin 阅读全文 »
posted @ 2020-03-29 17:33 程序员小宇 阅读(584) 评论(0) 推荐(0) 编辑
摘要: 不对,俩个对象的hashCode()相同,equals()不一定为true。 代码示例: 1 String str1 = "通话"; 2 String str2 = "重地"; 3 System.out.println(String.format("str1:%d | str2:%d", str1. 阅读全文 »
posted @ 2020-03-28 18:44 程序员小宇 阅读(1680) 评论(0) 推荐(0) 编辑
摘要: == 解读 对于基本类型和引用类型 == 的作用效果是不同的,如下所示: 基本类型:比较的是值是否相同; 引用类型:比较的是引用是否相同; 代码示例: 1 String x = "string"; 2 String y = "string"; 3 String z = new String("str 阅读全文 »
posted @ 2020-03-27 14:48 程序员小宇 阅读(836) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18
点击右上角即可分享
微信分享提示