- 两个字符串比较,必须使用equals()方法,而不能用 ==
String strA = "hello world";
String strB = "Hello world".toLowerCase();
System.out.println(strA == strB);
System.out.println(strA.equals(strB));
String strA = "hello world";
String strB = "Hello world".toLowerCase();
System.out.println(strA == strB);
System.out.println(strA.equals(strB));
本文标题:java 常见bug
本文链接:https://www.haomeiwen.com/subject/jbwfjrtx.html
网友评论