{"id":64192,"date":"2025-05-03T17:29:45","date_gmt":"2025-05-03T09:29:45","guid":{"rendered":"https:\/\/fwq.ai\/blog\/64192\/"},"modified":"2025-05-03T17:29:45","modified_gmt":"2025-05-03T09:29:45","slug":"%e5%a4%9a%e7%ba%bf%e7%a8%8b%e4%bf%ae%e6%94%b9%e5%8f%98%e9%87%8f%e5%80%bc%ef%bc%8c%e4%b8%ba%e4%bd%95%e4%b8%bb%e7%a8%8b%e5%ba%8f%e6%98%be%e7%a4%ba%e5%8e%9f%e5%80%bc%ef%bc%9f-3","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/64192\/","title":{"rendered":"\u591a\u7ebf\u7a0b\u4fee\u6539\u53d8\u91cf\u503c\uff0c\u4e3a\u4f55\u4e3b\u7a0b\u5e8f\u663e\u793a\u539f\u503c\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173054071937821.jpg\" class=\"aligncenter\" title=\"\u591a\u7ebf\u7a0b\u4fee\u6539\u53d8\u91cf\u503c\uff0c\u4e3a\u4f55\u4e3b\u7a0b\u5e8f\u663e\u793a\u539f\u503c\uff1f\u63d2\u56fe\" alt=\"\u591a\u7ebf\u7a0b\u4fee\u6539\u53d8\u91cf\u503c\uff0c\u4e3a\u4f55\u4e3b\u7a0b\u5e8f\u663e\u793a\u539f\u503c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5728\u7ebf\u7a0b\u4e2d\u4fee\u6539\u53d8\u91cf\u503c\uff0c\u4e3b\u7a0b\u5e8f\u4e3a\u4f55\u4ecd\u663e\u793a\u539f\u503c<\/strong><\/p>\n<p>\u6211\u4eec\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\u8fdb\u884c\u5206\u6790\uff1a<\/p>\n<pre>public class main {\n\n    public static void main(string[] args) throws interruptedexception {\n        values va = new values();\n        va.seta(2);\n        system.out.println(\"main:\" + va.geta());\n\n        threademo td = new threademo();\n        td.start();\n        td.join();\n\n        system.out.println(\"mainthread:\" + va.geta());\n    }\n\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u5728\u4e3b\u7a0b\u5e8f\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a values \u7c7b\u7684\u5b9e\u4f8b va\uff0c\u5e76\u8bbe\u7f6e\u5176 a \u5b57\u6bb5\u4e3a 2\u3002\u7136\u540e\uff0c\u6211\u4eec\u542f\u52a8\u4e00\u4e2a\u7ebf\u7a0b td \u5e76\u7b49\u5f85\u5b83\u5b8c\u6210\u3002<\/p>\n<pre>public class values {\n    private int a;\n\n    public int getA() {\n        return a;\n    }\n\n    public void setA(int a) {\n        this.a = a;\n    }\n}<\/pre>\n<p>  \u767b\u5f55\u540e\u590d\u5236   <\/p>\n<p>\u7ebf\u7a0b td \u4e2d\u6ca1\u6709\u5bf9 va \u53d8\u91cf\u8fdb\u884c\u4efb\u4f55\u4fee\u6539\uff0c\u56e0\u6b64 va \u5728\u4e3b\u7a0b\u5e8f\u4e2d\u7684\u503c\u4e0d\u4f1a\u6539\u53d8\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u591a\u7ebf\u7a0b\u4fee\u6539\u53d8\u91cf\u503c\uff0c\u4e3a\u4f55\u4e3b\u7a0b\u5e8f\u663e\u793a\u539f\u503c\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>\u5728\u7ebf\u7a0b\u4e2d\u4fee\u6539\u53d8\u91cf\u503c\uff0c\u4e3b\u7a0b\u5e8f\u4e3a\u4f55\u4ecd\u663e\u793a\u539f\u503c \u6211\u4eec\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\u8fdb\u884c\u5206\u6790\uff1a public class main { public static void main(string[] args) throws interruptedexception { values va = new values(); va.seta(2); system.out.println(&#8220;main:&#8221; + va.geta()); threademo td = new threademo(); td.start(); td.join(); system.out.println(&#8220;mainthread:&#8221; + va.geta()); } } \u767b\u5f55\u540e\u590d\u5236 \u5728\u4e3b\u7a0b\u5e8f\u4e2d\uff0c\u6211\u4eec\u521b\u5efa\u4e86\u4e00\u4e2a values \u7c7b\u7684\u5b9e\u4f8b va\uff0c\u5e76\u8bbe\u7f6e\u5176 a \u5b57\u6bb5\u4e3a 2\u3002\u7136\u540e\uff0c\u6211\u4eec\u542f\u52a8\u4e00\u4e2a\u7ebf\u7a0b td \u5e76\u7b49\u5f85\u5b83\u5b8c\u6210\u3002 public class values { private int a; public int getA() [&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-64192","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64192","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=64192"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/64192\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=64192"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=64192"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=64192"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}