{"id":73,"date":"2021-04-26T11:14:14","date_gmt":"2021-04-26T03:14:14","guid":{"rendered":"http:\/\/112.124.66.68\/?p=73"},"modified":"2021-04-26T11:14:14","modified_gmt":"2021-04-26T03:14:14","slug":"equals%e4%b8%8e%e7%9a%84%e5%8c%ba%e5%88%ab","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2021\/04\/26\/equals%e4%b8%8e%e7%9a%84%e5%8c%ba%e5%88%ab\/","title":{"rendered":"equals\u4e0e==\u7684\u533a\u522b"},"content":{"rendered":"<p><span style=\"color: #ff6600;\">&nbsp;== \uff1a<\/span><br \/>\n== \u6bd4\u8f83\u7684\u662f<span style=\"color: #ff6600;\">\u53d8\u91cf(\u6808)\u5185\u5b58\u4e2d\u5b58\u653e\u7684\u5bf9\u8c61\u7684(\u5806)\u5185\u5b58\u5730\u5740\uff0c\u7528\u6765\u5224\u65ad\u4e24\u4e2a\u5bf9\u8c61\u7684\u5730\u5740\u662f\u5426\u76f8\u540c\uff0c\u5373\u662f\u5426\u662f\u6307\u76f8\u540c\u4e00\u4e2a\u5bf9\u8c61<\/span>\u3002<span style=\"color: #ff6600;\">\u6bd4\u8f83\u7684\u662f\u771f\u6b63\u610f\u4e49\u4e0a\u7684\u6307\u9488\u64cd\u4f5c<\/span>\u3002<br \/>\n1\u3001\u6bd4\u8f83\u7684\u662f\u64cd\u4f5c\u7b26\u4e24\u7aef\u7684\u64cd\u4f5c\u6570\u662f\u5426\u662f\u540c\u4e00\u4e2a\u5bf9\u8c61\u3002<br \/>\n2\u3001\u4e24\u8fb9\u7684\u64cd\u4f5c\u6570\u5fc5\u987b\u662f\u540c\u4e00\u7c7b\u578b\u7684\uff08\u53ef\u4ee5\u662f\u7236\u5b50\u7c7b\u4e4b\u95f4\uff09\u624d\u80fd\u7f16\u8bd1\u901a\u8fc7\u3002<br \/>\n3\u3001\u6bd4\u8f83\u7684\u662f\u5730\u5740\uff0c\u5982\u679c\u662f\u5177\u4f53\u7684\u963f\u62c9\u4f2f\u6570\u5b57\u7684\u6bd4\u8f83\uff0c\u503c\u76f8\u7b49\u5219\u4e3atrue\uff0c<br \/>\n\u5982\uff1aint a=10 \u4e0e long b=10L \u4e0e double c=10.0\u90fd\u662f\u76f8\u540c\u7684\uff08\u4e3atrue\uff09\uff0c<br \/>\n\u56e0\u4e3a\u4ed6\u4eec\u90fd\u6307\u5411\u5730\u5740\u4e3a10\u7684\u5806\u3002<!--more--><\/p>\n<p><span style=\"color: #ff6600;\">equals\uff1a<\/span><br \/>\nequals\u7528\u6765\u6bd4\u8f83\u7684\u662f\u4e24\u4e2a\u5bf9\u8c61\u7684\u5185\u5bb9\u662f\u5426\u76f8\u7b49\uff0c\u7531\u4e8e\u6240\u6709\u7684\u7c7b\u90fd\u662f\u7ee7\u627f\u81eajava.lang.Object\u7c7b\u7684\uff0c<br \/>\n\u6240\u4ee5\u9002\u7528\u4e8e\u6240\u6709\u5bf9\u8c61\uff0c\u5982\u679c\u6ca1\u6709\u5bf9\u8be5\u65b9\u6cd5\u8fdb\u884c\u8986\u76d6\u7684\u8bdd\uff0c<br \/>\n\u8c03\u7528\u7684\u4ecd\u7136\u662fObject\u7c7b\u4e2d\u7684\u65b9\u6cd5\uff0c\u800cObject\u4e2d\u7684equals\u65b9\u6cd5\u8fd4\u56de\u7684\u5374\u662f==\u7684\u5224\u65ad\u3002<\/p>\n<p><span style=\"color: #ff6600;\">\u603b\u7ed3\uff1a<\/span><br \/>\n\u6240\u6709\u6bd4\u8f83\u662f\u5426\u76f8\u7b49\u65f6\uff0c\u90fd\u662f\u7528equals \u5e76\u4e14\u5728\u5bf9\u5e38\u91cf\u76f8\u6bd4\u8f83\u65f6\uff0c\u628a\u5e38\u91cf\u5199\u5728\u524d\u9762\uff0c<br \/>\n\u56e0\u4e3a\u4f7f\u7528object\u7684equals object\u53ef\u80fd\u4e3anull \u5219\u7a7a\u6307\u9488<br \/>\n\u5728\u963f\u91cc\u7684\u4ee3\u7801\u89c4\u8303\u4e2d\u53ea\u4f7f\u7528equals \uff0c\u963f\u91cc\u63d2\u4ef6\u9ed8\u8ba4\u4f1a\u8bc6\u522b\uff0c\u5e76\u53ef\u4ee5\u5feb\u901f\u4fee\u6539\uff0c<br \/>\n\u63a8\u8350\u5b89\u88c5\u963f\u91cc\u63d2\u4ef6\u6765\u6392\u67e5\u8001\u4ee3\u7801\u4f7f\u7528\u201c==\u201d\uff0c\u66ff\u6362\u6210equals<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp;== \uff1a == \u6bd4\u8f83&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":325,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-73","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/73","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/comments?post=73"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/73\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media\/325"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}