{"id":378,"date":"2021-05-05T11:14:35","date_gmt":"2021-05-05T03:14:35","guid":{"rendered":"http:\/\/112.124.66.68\/?p=378"},"modified":"2021-05-05T11:14:35","modified_gmt":"2021-05-05T03:14:35","slug":"378","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2021\/05\/05\/378\/","title":{"rendered":"static\u90fd\u6709\u54ea\u4e9b\u7528\u6cd5?"},"content":{"rendered":"\n<p> \u6240\u6709\u7684\u4eba\u90fd\u77e5\u9053static\u5173\u952e\u5b57\u8fd9\u4e24\u4e2a\u57fa\u672c\u7684\u7528\u6cd5:\u9759\u6001\u53d8\u91cf\u548c\u9759\u6001\u65b9\u6cd5.\u4e5f\u5c31\u662f\u88abstatic\u6240\u4fee\u9970\u7684\u53d8\u91cf\/\u65b9\u6cd5<br>\u90fd\u5c5e\u4e8e\u7c7b\u7684\u9759\u6001\u8d44\u6e90,\u7c7b\u5b9e\u4f8b\u6240\u5171\u4eab.<br>\u9664\u4e86\u9759\u6001\u53d8\u91cf\u548c\u9759\u6001\u65b9\u6cd5\u4e4b\u5916,static\u4e5f\u7528\u4e8e\u9759\u6001\u5757,\u591a\u7528\u4e8e\u521d\u59cb\u5316\u64cd\u4f5c:<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public calss PreCache{\nstatic{\n\/\/\u6267\u884c\u76f8\u5173\u64cd\u4f5c\n}\n}<\/code><\/pre>\n\n\n\n<p>\u6b64\u5916static\u4e5f\u591a\u7528\u4e8e\u4fee\u9970\u5185\u90e8\u7c7b,\u6b64\u65f6\u79f0\u4e4b\u4e3a\u9759\u6001\u5185\u90e8\u7c7b.<br>\u6700\u540e\u4e00\u79cd\u7528\u6cd5\u5c31\u662f\u9759\u6001\u5bfc\u5305,\u5373 import static .import static\u662f\u5728JDK 1.5\u4e4b\u540e\u5f15\u5165\u7684\u65b0\u7279\u6027,\u53ef\u4ee5\u7528\u6765<br>\u6307\u5b9a\u5bfc\u5165\u67d0\u4e2a\u7c7b\u4e2d\u7684\u9759\u6001\u8d44\u6e90,\u5e76\u4e14\u4e0d\u9700\u8981\u4f7f\u7528\u7c7b\u540d,\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u8d44\u6e90\u540d,\u6bd4\u5982:<\/p>\n\n\n\n<p> <\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import static java.lang.Math.*;\npublic class Test{\npublic static void main(String&#91;] args){\n\/\/System.out.println(Math.sin(20));\u4f20\u7edf\u505a\u6cd5\nSystem.out.println(sin(20));\n}\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6240\u6709\u7684\u4eba\u90fd\u77e5\u9053static\u5173\u952e\u5b57&#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-378","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\/378","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=378"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/378\/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=378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}