We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
String s1 = new String("abc"); String s2 = "abc"; System.out.println(s1 == s2); System.out.println(s1.equals(s2));
The text was updated successfully, but these errors were encountered:
String s1 = new String("abc"); //s1指向堆内存对象的地址值 String s2 = "abc"; //s2指向常量池中对象的地址值 System.out.println(s1 == s2); //地址不相同,打印false System.out.println(s1.equals(s2)); //比较内容,不关注对象引用地址,打印true
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: