{"id":116,"date":"2017-02-12T16:55:00","date_gmt":"2017-02-12T08:55:00","guid":{"rendered":"https:\/\/cn1.club\/?p=116"},"modified":"2025-03-13T20:12:25","modified_gmt":"2025-03-13T12:12:25","slug":"day3-%e7%ac%94%e8%ae%b0-%e4%b8%89%e5%85%83%e8%bf%90%e7%ae%97%e7%ac%a6%e7%9a%84%e5%9f%ba%e6%9c%ac%e7%94%a8%e6%b3%95-%e5%92%8c-%e4%b8%89%e5%85%83%e8%bf%90%e7%ae%97%e7%ac%a6-%e7%9a%84%e7%bb%83%e4%b9%a0","status":"publish","type":"post","link":"https:\/\/cn1.club\/?p=116","title":{"rendered":"Day3 \u7b14\u8bb0 \u4e09\u5143\u8fd0\u7b97\u7b26\u7684\u57fa\u672c\u7528\u6cd5 \u548c \u4e09\u5143\u8fd0\u7b97\u7b26 \u7684\u7ec3\u4e60"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >class Demo6_Operator {\n\tpublic static void main(String&#091;] args) {\n\t\t\/\/(\u5173\u7cfb\u8868\u8fbe\u5f0f) ? \u8868\u8fbe\u5f0f1 : \u8868\u8fbe\u5f0f2 ;\n\t\tint x = 10;\n\t\tint y =5;\n\t\tint z;\n\t\tz = (x &gt; y) ? x : y;\n\t\tSystem.out.println(&quot;x \u4e0e y \u5982\u679cx\u5927\u4e8ey\u5219 =\u771f(\u5c06x\u8d4b\u503c\u7ed9z)  \u5982\u679cx\u5927\u4e8ey\u5219 = \u5047 (\u5c06 y \u8d4b\u503c\u7ed9z )&quot; + z);\n\t}\n}<\/code><\/pre>\n\n\n\n<p><strong>\u4e09\u5143\u8fd0\u7b97\u7b26\u7684\u7ec3\u4e60:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"prettyprint\" >class Test1_Operator {\n\tpublic static void main(String&#091;] args) {\n\t\t\/*\n\t\tA:\u6bd4\u8f83\u4e24\u4e2a\u6574\u6570\u662f\u5426\u76f8\u540c\n\n\t\t*\/\n\n\t\t\/\/int x = 15;\n\t\t\/\/int y = 3;\n\n\t\t\/\/boolean b = (x == y);\n\n\t\t\/\/System.out.println(&quot;b = &quot; + b);\t\t\t\/\/false\n\n\n\t\t\/\/B:\u83b7\u53d6\u4e09\u4e2a\u6574\u6570\u4e2d\u7684\u6700\u5927\u503c\n\t\tint a =88;\n\t\tint b =99;\n\t\tint c =1;\n\t\t\/\/\u5148\u6bd4\u8f83\u4efb\u610f\u4e24\u4e2a\u6570\u7684\u503c,\u627e\u51fa\u8fd9\u4e24\u4e2a\u6570\u4e2d\u7684\u6700\u5927\u503c\n\t\tint max = (a &gt; b) ? a : b;\t\t\t\/\/\u6bd4\u8f83a b\u4e24\u4e2a\u53d8\u91cf\u7684\u503c \u5982\u679ca \u5927\u4e8eb \u5219\u5c06a\u8d4b\u503c\u7ed9 max \u53cd\u4e4b\u5219\u5c06 b \u8d4b\u503c\u7ed9max\n\t\t\/\/\u7528\u524d\u4e24\u4e2a\u6570\u7684\u6700\u5927\u503c\u4e0e\u7b2c\u4e09\u4e2a\u6570\u5b57\u6bd4\u8f83,\u83b7\u53d6\u6700\u5927\u503c\n\t\tmax = (c &gt; max ) ? c : max;\t\t\t\/\/\u6bd4\u8f83 c max \u4e24\u4e2a\u53d8\u91cf\u7684\u503c.\u540c\u4e0a \n\n\t\tSystem.out.println(&quot;max = &quot; + max);\n\n\t\tSystem.out.println(&quot;----by Rick&quot;);\n\n\n\t}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4e09\u5143\u8fd0\u7b97\u7b26\u7684\u7ec3\u4e60:<\/p>\n","protected":false},"author":1,"featured_media":196,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[5],"tags":[],"class_list":["post-116","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-xuexi"],"_links":{"self":[{"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/posts\/116","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=116"}],"version-history":[{"count":0,"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/posts\/116\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=\/wp\/v2\/media\/196"}],"wp:attachment":[{"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=116"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=116"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn1.club\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=116"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}