{"id":1435,"date":"2017-05-12T20:46:40","date_gmt":"2017-05-12T12:46:40","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=1435"},"modified":"2017-05-12T20:46:40","modified_gmt":"2017-05-12T12:46:40","slug":"%e5%85%b3%e4%ba%8ejava-%e6%93%8d%e4%bd%9c%e7%ac%a6%e6%97%a0%e6%b3%95%e7%bc%96%e8%af%91%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=1435","title":{"rendered":"\u5173\u4e8eJava += \u64cd\u4f5c\u7b26\u65e0\u6cd5\u7f16\u8bd1\u7684\u95ee\u9898"},"content":{"rendered":"<p>\n\t\u8fd9\u4e2a\u95ee\u9898\u6765\u81ea\u4e8e<a href=\"http:\/\/stackoverflow.com\/\" name=\"stackoverflow\" target=\"_blank\" title=\"stackoverflow\">stackoverflow<\/a>\u3002\u6211\u770b\u8fd9\u4e2a\u95ee\u9898\u88ab\u8ba8\u8bba\u7684\u975e\u5e38\u591a\uff01\u5728\u8fd9\u91cc\u5206\u4eab\u4e00\u4e0b\uff0c\u505a\u4e2a\u603b\u7ed3\uff01\u4ee5\u540e\u5c31\u53ef\u4ee5\u88c5\u903c\u7ed9<a href=\"http:\/\/baike.baidu.com\/item\/\u7801\u519c\" name=\"\u7801\u519c\" target=\"_blank\" title=\"\u7801\u519c\">\u7801\u519c<\/a>\u770b\uff01\n<\/p>\n<p>\n\t\u76f4\u5230\u4eca\u5929\u6709\u4eba\u8ba4\u4e3a\u4e0b\u9762\u8fd9\u4e2a\u4f8b\u5b50\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\ni += j;<\/pre>\n<p>\n\t\u53ea\u662f\u4e00\u4e2a\u7b80\u5199\u3002\u5b83\u88ab\u8ba4\u4e3a\u7c7b\u4f3c\u4e8e\u4e0b\u9762\u7684\u5199\u6cd5\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\ni = i + j;<\/pre>\n<p>\n\t\u8fd9\u6837\u505a\u5176\u5b9e\u662f\u9519\u7684\u3002\u4f8b\u5982\u4e0b\u9762\u7684\u4f8b\u5b50\uff0c\u5c31\u65e0\u6cd5\u901a\u8fc7\u7f16\u8bd1\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\nint i = 5;\r\nlong j = 8;<\/pre>\n<p>\n\t\u7136\u800c i = i + j; \u6ca1\u6cd5\u7f16\u8bd1\uff0c\u800c i += j; \u5c31\u53ef\u4ee5\u7f16\u8bd1\u3002\n<\/p>\n<p>\n\t\u8fd9\u610f\u5473\u7740i += j; \u5b9e\u9645\u4e0a\u662fi = (type of i) (i + j)\u7684\u7b80\u5199\u4e48\uff1f\n<\/p>\n<p>\n\t\u5199\u5230\u8fd9\u91cc\uff0c\u6211\u4eec\u5c31\u9700\u8981\u56de\u987e\u4e00\u4e0b<a href=\"http:\/\/docs.oracle.com\/javase\/specs\/jls\/se8\/html\/jls-15.html#jls-15.26.2\" name=\"\u00a715.26.2\u590d\u5408\u8d4b\u503c\u8fd0\u7b97\u7b26\" target=\"_blank\" title=\"\u00a715.26.2\u590d\u5408\u8d4b\u503c\u8fd0\u7b97\u7b26\">java\u7684\u590d\u5408\u8fd0\u7b97\u7b26<\/a>\u3002\n<\/p>\n<blockquote>\n<p>\n\t\tE1 op= E2 \u578b\u7684\u590d\u5408\u8d4b\u503c\u8868\u8fbe\u5f0f\u7b49\u4ef7\u4e8e E1 = (T)((E1) op (E2))\uff0c\u8fd9\u91cc T \u662f E1 \u7684\u7c7b\u578b\uff0c\u4e0d\u540c\u7684\u662f E1 \u53ea\u8ba1\u7b97\u4e00\u6b21\u3002\n\t<\/p>\n<\/blockquote>\n<p>\n\t\u4e00\u4e2a\u4f8b\u5b50\uff0c\u5f15\u81ea <a href=\"http:\/\/docs.oracle.com\/javase\/specs\/jls\/se8\/html\/jls-15.html#jls-15.26.2\" target=\"_blank\">&sect;15.26.2<\/a>\n<\/p>\n<p>\n\t\u4e0b\u9762\u7684\u4ee3\u7801\u662f\u6b63\u786e\u7684\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\nshort x = 3;\r\nx += 4.6;<\/pre>\n<p>\n\tx\u7684\u7ed3\u679c\u7b49\u4e8e7\uff0c\u56e0\u4e3a\u5b83\u7b49\u4ef7\u4e8e\uff1a\n<\/p>\n<pre class=\"brush:java;\">\r\nshort x = 3;\r\nx = (short)(x + 4.6);<\/pre>\n<p>\n\t\u770b\u5230\u8fd9\u91cc\uff0c\u5c31\u8bc1\u660e\u4e86\u4f60\u7684\u731c\u6d4b\u662f\u6b63\u786e\u7684\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=1435\">\u5173\u4e8eJava += \u64cd\u4f5c\u7b26\u65e0\u6cd5\u7f16\u8bd1\u7684\u95ee\u9898<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u8fd9\u4e2a\u95ee\u9898\u6765\u81ea\u4e8estackoverflow\u3002\u6211\u770b\u8fd9\u4e2a\u95ee\u9898\u88ab\u8ba8\u8bba\u7684\u975e\u5e38\u591a\uff01\u5728\u8fd9\u91cc\u5206\u4eab\u4e00\u4e0b\uff0c\u505a\u4e2a\u603b\u7ed3\uff01\u4ee5\u540e\u5c31\u53ef\u4ee5\u88c5\u903c [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[69,1159,1157,1160,1158],"class_list":["post-1435","post","type-post","status-publish","format-standard","hentry","category-java","tag-java","tag-1159","tag-1157","tag-1160","tag-1158"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1435","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1435"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1435\/revisions"}],"predecessor-version":[{"id":1436,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1435\/revisions\/1436"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}