{"id":64807,"date":"2025-05-03T16:56:03","date_gmt":"2025-05-03T08:56:03","guid":{"rendered":"https:\/\/fwq.ai\/blog\/64807\/"},"modified":"2025-05-03T16:56:03","modified_gmt":"2025-05-03T08:56:03","slug":"java-%e4%b8%ad%ef%bc%8cint%e3%80%81integer%e3%80%81double%e3%80%81double-%e7%94%a8-%e6%af%94%e8%be%83%e6%97%b6%e9%9c%80%e8%a6%81%e6%b3%a8%e6%84%8f%e4%bb%80%e4%b9%88%ef%bc%9f-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/64807\/","title":{"rendered":"Java \u4e2d\uff0cint\u3001Integer\u3001double\u3001Double \u7528 == \u6bd4\u8f83\u65f6\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173077633199583.jpg\" class=\"aligncenter\" title=\"Java \u4e2d\uff0cint\u3001Integer\u3001double\u3001Double \u7528 == \u6bd4\u8f83\u65f6\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f\u63d2\u56fe\" alt=\"Java \u4e2d\uff0cint\u3001Integer\u3001double\u3001Double \u7528 == \u6bd4\u8f83\u65f6\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>int\u3001Integer\u3001double\u3001Double \u7528 == \u6bd4\u8f83\u7684\u5dee\u5f02<\/strong><\/p>\n<p>\u5728 Java \u4e2d\uff0c\u4f7f\u7528 == \u8fd0\u7b97\u7b26\u6bd4\u8f83\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double \u7b49\uff09\u548c\u5305\u88c5\u7c7b\uff08\u5982 Integer\u3001Double\uff09\u5b58\u5728\u4e00\u4e9b\u4ee4\u4eba\u56f0\u60d1\u7684\u5730\u65b9\u3002<\/p>\n<p><strong>\u57fa\u672c\u6570\u636e\u7c7b\u578b<\/strong><\/p>\n<ul>\n<li>int a = 10 \u548c double c = 10 \u5b58\u50a8\u7684\u662f\u539f\u59cb\u503c\uff0c\u5b83\u4eec\u88ab\u89c6\u4e3a\u4e8c\u8fdb\u5236\u8868\u793a\uff0c\u56e0\u6b64\u53ef\u4ee5\u76f4\u63a5\u6bd4\u8f83\u3002\u56e0\u6b64\uff0ca == c \u662f true\u3002<\/li>\n<\/ul>\n<p><strong>\u5305\u88c5\u7c7b<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<ul>\n<li>Double b = 10.0 \u548c Double d = 10.0 \u5b58\u50a8\u7684\u662f\u5f15\u7528\u53d8\u91cf\uff0c\u5b83\u4eec\u6307\u5411\u7740\u5305\u542b\u539f\u59cb\u503c\u7684\u5806\u4e2d\u7684\u5bf9\u8c61\u3002\u5f53\u4f7f\u7528 == \u6bd4\u8f83\u65f6\uff0c\u6bd4\u8f83\u7684\u662f\u5bf9\u8c61\u5f15\u7528\uff0c\u5373\u5185\u5b58\u5730\u5740\u3002\u56e0\u6b64\uff0cb == d \u662f false\u3002<\/li>\n<\/ul>\n<p><strong>\u7f16\u8bd1\u5668\u9519\u8bef<\/strong><\/p>\n<ul>\n<li>Integer e = 10 \u548c Double b = 10.0 \u4f7f\u7528 == \u6bd4\u8f83\u65f6\u7f16\u8bd1\u51fa\u9519\uff0c\u8fd9\u662f\u56e0\u4e3a Integer \u662f\u4e00\u79cd\u5bf9\u8c61\uff0c\u800c Double \u4e5f\u662f\u4e00\u79cd\u5bf9\u8c61\uff0c\u5b83\u4eec\u662f\u4e0d\u540c\u7684\u7c7b\u578b\uff0c\u4e0d\u80fd\u76f4\u63a5\u76f8\u4e92\u6bd4\u8f83\u3002<\/li>\n<\/ul>\n<p><strong>\u603b\u7ed3<\/strong><\/p>\n<p>\u8981\u6b63\u786e\u6bd4\u8f83\u57fa\u672c\u6570\u636e\u7c7b\u578b\u548c\u5305\u88c5\u7c7b\uff0c\u9700\u8981\u8003\u8651\u5b83\u4eec\u5728\u5185\u5b58\u4e2d\u7684\u8868\u793a\u5f62\u5f0f\u548c\u6bd4\u8f83\u7684\u7c7b\u578b\u3002\u5bf9\u4e8e\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u4f7f\u7528 == \u6bd4\u8f83\u5b83\u4eec\u7684\u539f\u59cb\u503c\uff0c\u800c\u5bf9\u4e8e\u5305\u88c5\u7c7b\uff0c\u9700\u8981\u5148\u660e\u786e\u6bd4\u8f83\u7684\u662f\u5bf9\u8c61\u5f15\u7528\u8fd8\u662f\u539f\u59cb\u503c\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fJava \u4e2d\uff0cint\u3001Integer\u3001double\u3001Double \u7528 == \u6bd4\u8f83\u65f6\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8IDCBABY\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>int\u3001Integer\u3001double\u3001Double \u7528 == \u6bd4\u8f83\u7684\u5dee\u5f02 \u5728 Java \u4e2d\uff0c\u4f7f\u7528 == \u8fd0\u7b97\u7b26\u6bd4\u8f83\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double \u7b49\uff09\u548c\u5305\u88c5\u7c7b\uff08\u5982 Integer\u3001Double\uff09\u5b58\u5728\u4e00\u4e9b\u4ee4\u4eba\u56f0\u60d1\u7684\u5730\u65b9\u3002 \u57fa\u672c\u6570\u636e\u7c7b\u578b int a = 10 \u548c double c = 10 \u5b58\u50a8\u7684\u662f\u539f\u59cb\u503c\uff0c\u5b83\u4eec\u88ab\u89c6\u4e3a\u4e8c\u8fdb\u5236\u8868\u793a\uff0c\u56e0\u6b64\u53ef\u4ee5\u76f4\u63a5\u6bd4\u8f83\u3002\u56e0\u6b64\uff0ca == c \u662f true\u3002 \u5305\u88c5\u7c7b \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b Double b = 10.0 \u548c Double d = 10.0 \u5b58\u50a8\u7684\u662f\u5f15\u7528\u53d8\u91cf\uff0c\u5b83\u4eec\u6307\u5411\u7740\u5305\u542b\u539f\u59cb\u503c\u7684\u5806\u4e2d\u7684\u5bf9\u8c61\u3002\u5f53\u4f7f\u7528 == \u6bd4\u8f83\u65f6\uff0c\u6bd4\u8f83\u7684\u662f\u5bf9\u8c61\u5f15\u7528\uff0c\u5373\u5185\u5b58\u5730\u5740\u3002\u56e0\u6b64\uff0cb == d \u662f false\u3002 \u7f16\u8bd1\u5668\u9519\u8bef Integer e = 10 \u548c Double b = 10.0 \u4f7f\u7528 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-64807","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=64807"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64807\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=64807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=64807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=64807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}