{"id":386,"date":"2023-03-30T23:04:28","date_gmt":"2023-03-28T10:38:16","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/index.php\/2023\/11\/30\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/"},"modified":"2025-08-02T03:32:45","modified_gmt":"2025-08-01T19:32:45","slug":"%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/","title":{"rendered":"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3"},"content":{"rendered":"<p>\u4f5c\u4e3a\u201c\u5199\u4f5c\u6362\u6350\u201d\u8ba1\u5212\u7684\u4e00\u90e8\u5206\uff0c\u4f5c\u8005\u9009\u62e9\u4e86\u81ea\u7531\u5f00\u6e90\u57fa\u91d1\u4f1a\u4f5c\u4e3a\u53d7\u8d60\u65b9\u3002<\/p>\n<h3>\u4ecb\u7ecdJava\u662f\u4e00\u79cd\u9759\u6001\u7c7b\u578b\u7684\u7f16\u7a0b\u8bed\u8a00\u3002\u8fd9\u610f\u5473\u7740\u5f53\u4f60\u521b\u5efa\u4e00\u4e2a\u53d8\u91cf\u65f6\uff0c\u4f60\u5fc5\u987b\u540c\u65f6\u6307\u5b9a\u5b83\u7684\u6570\u636e\u7c7b\u578b\uff0c\u4e5f\u5c31\u662f\u5b83\u6240\u5b58\u50a8\u7684\u4fe1\u606f\u7684\u7c7b\u578b\u3002\u8fd9\u4e0e\u52a8\u6001\u7c7b\u578b\u7684\u8bed\u8a00\uff08\u4f8b\u5982PHP\uff09\u5f62\u6210\u4e86\u5bf9\u6bd4\u3002\u4f7f\u7528\u52a8\u6001\u7c7b\u578b\u7684\u8bed\u8a00\uff0c\u4f60\u4e0d\u9700\u8981\u6307\u5b9a\u53d8\u91cf\u7684\u6570\u636e\u7c7b\u578b\uff0c\u8fd9\u53ef\u80fd\u4f1a\u8ba9\u4eba\u611f\u5230\u8f7b\u677e\u4e00\u4e9b\u3002<\/p>\n<p>\u7136\u800c\uff0c\u4e86\u89e3\u6570\u636e\u7c7b\u578b\u5e76\u9002\u5f53\u5730\u4f7f\u7528\u5b83\u4eec\u53ef\u4ee5\u8ba9\u5f00\u53d1\u4eba\u5458\u4f18\u5316\u4ed6\u4eec\u7684\u4ee3\u7801\uff0c\u56e0\u4e3a\u6bcf\u79cd\u6570\u636e\u7c7b\u578b\u90fd\u6709\u7279\u5b9a\u7684\u8d44\u6e90\u9700\u6c42\u3002\u53e6\u5916\uff0c\u5982\u679c\u4f60\u6307\u5b9a\u4e86\u4e00\u4e2a\u6570\u636e\u7c7b\u578b\u5e76\u5c1d\u8bd5\u5b58\u50a8\u4e00\u4e2a\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e\uff0c\u4f8b\u5982\u51fa\u9519\u65f6\uff0c\u4f60\u5c06\u65e0\u6cd5\u7f16\u8bd1\u4ee3\u7801\u3002\u56e0\u6b64\uff0c\u5728\u9759\u6001\u7c7b\u578b\u8bed\u8a00\u4e2d\uff0c\u60a8\u751a\u81f3\u53ef\u4ee5\u5728\u4efb\u4f55\u6d4b\u8bd5\u4e4b\u524d\u5c31\u80fd\u591f\u68c0\u6d4b\u5230\u9519\u8bef\u3002<\/p>\n<p>Java\u62e5\u6709\u4e24\u79cd\u6570\u636e\u7c7b\u578b\uff1a\u539f\u59cb\u7c7b\u578b\u548c\u5f15\u7528\u7c7b\u578b\uff08\u4e5f\u79f0\u4e3a\u975e\u539f\u59cb\u7c7b\u578b\uff09\u3002\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u60a8\u5c06\u4f7f\u7528\u53d8\u91cf\u6765\u5b58\u50a8\u548c\u4f7f\u7528Java\u7a0b\u5e8f\u4e2d\u7684\u4fe1\u606f\uff0c\u4ee5\u4e86\u89e3Java\u4e2d\u5e38\u7528\u7684\u4e00\u4e9b\u6570\u636e\u7c7b\u578b\u3002\u8fd9\u5e76\u4e0d\u662f\u5bf9\u6240\u6709\u6570\u636e\u7c7b\u578b\u7684\u8be6\u5c3d\u6982\u8ff0\uff0c\u4f46\u672c\u6307\u5357\u5c06\u5e2e\u52a9\u60a8\u719f\u6089Java\u4e2d\u53ef\u7528\u7684\u9009\u9879\u3002<\/p>\n<h2>\u5148\u51b3\u6761\u4ef6\u8bf7\u53c2\u7167\u672c\u6559\u7a0b\uff0c\u60a8\u9700\u8981\u51c6\u5907\u4ee5\u4e0b\u7269\u54c1\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>An environment in which you can execute Java programs to follow along with the examples. To set this up on your local machine, you will need the following:Java (version 11 or above) installed on your machine, with the compiler provided by the Java Development Kit (JDK). For Ubuntu and Debian, follow the steps for Option 1 in our tutorial, How To Install Java with Apt on Ubuntu 22.04. For other operating systems, including Mac and Windows, see the download options for Java installation.<br \/>\nTo compile and run the code examples, this tutorial uses Java Shell, a Read-Evaluate-Print Loop (REPL) run from the command line. To get started with JShell, check out the Introduction to JShell guide.<\/li>\n<li>Familiarity with Java and object-oriented programming, which you can find in our tutorial, How To Write Your First Program in Java.<\/li>\n<\/ul>\n<h2>\u539f\u59cb\u7c7b\u578bJava\u7684\u57fa\u672c\u7c7b\u578b\u662fJava\u4e2d\u6700\u7b80\u5355\u548c\u6700\u57fa\u672c\u7684\u6570\u636e\u7c7b\u578b\u3002\u5b83\u4eec\u4ee3\u8868\u539f\u59cb\u503c\uff0c\u5982\u6570\u5b57\u548c\u5b57\u7b26\u3002\u6700\u5e38\u7528\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u5305\u62ecint\uff08\u6574\u6570\uff09\u3001boolean\uff08\u5e03\u5c14\u503c\uff09\u548cchar\uff08\u5b57\u7b26\uff09\u3002\u60a8\u53ef\u4ee5\u5728\u5b98\u65b9\u7684Java\u6570\u636e\u7c7b\u578b\u6587\u6863\u4e2d\u627e\u5230\u5176\u4ed6\u7c7b\u578b\u3002<\/p>\n<h3>\u6574\u6570\u6574\u6570\u65e2\u53ef\u4ee5\u662f\u8d1f\u6570\u4e5f\u53ef\u4ee5\u662f\u6b63\u6570\u7684\u6574\u6570\u3002\u5728Java\u4e2d\uff0c\u4f60\u5c06\u4f7f\u7528int\u6765\u5b58\u50a8\u5b83\u4eec\u3002int\u53ef\u4ee5\u5bb9\u7eb3\u8db3\u591f\u5927\u7684\u6570\u5b57\u6765\u6ee1\u8db3\u5927\u591a\u6570\u76ee\u7684\uff1a\u4ece-2,147,483,648\u52302,147,483,647\u3002<\/p>\n<p>\u8ba9\u6211\u4eec\u6765\u770b\u4e00\u4e2a\u4f7f\u7528int\u7684\u4f8b\u5b50\uff1a<\/p>\n<pre class=\"post-pre\"><code><mark><span class=\"token keyword\">int<\/span><\/mark> theAnswer <span class=\"token operator\">=<\/span> <span class=\"token number\">42<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>\u539f\u59cb\u7c7b\u578b\u603b\u662f\u4ee5\u5c0f\u5199\u5b57\u6bcd\u5f00\u5934\uff08int\uff09\u3002Java \u8bed\u6cd5\u89c4\u5b9a\u60a8\u9996\u5148\u8981\u6307\u5b9a\u6570\u636e\u7c7b\u578b\uff08int\uff09\uff0c\u7136\u540e\u662f\u53d8\u91cf\u540d\u79f0\uff08theAnswer\uff09\u3002\u6b64\u540e\uff0c\u60a8\u4f7f\u7528\u7b49\u53f7\uff08=\uff09\u5c06\u503c42\u8d4b\u7ed9\u8be5\u53d8\u91cf\u3002<\/p>\n<p>\u65e0\u8bba\u5176\u6570\u636e\u7c7b\u578b\u5982\u4f55\uff0c\u60a8\u90fd\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7\u6307\u5b9a\u53d8\u91cf\u540d\u6765\u4f7f\u7528\u53d8\u91cf\uff0c\u800c\u4e0d\u9700\u8981\u5728\u524d\u9762\u6dfb\u52a0\u4efb\u4f55\u7279\u6b8a\u5b57\u7b26\u3002\u8fd9\u662f\u56e0\u4e3aJava\u53ef\u4ee5\u5c06\u5176\u8bc6\u522b\u4e3a\u53d8\u91cf\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u6ce8\u610f\uff1a\u53d8\u91cftheAnswer\u7684\u540d\u79f0\u4ee5\u53ca\u672c\u6559\u7a0b\u4e2d\u7684\u6240\u6709\u5176\u4ed6\u53d8\u91cf\u90fd\u91c7\u7528\u9a7c\u5cf0\u547d\u540d\u6cd5\u3002\u5c3d\u7ba1\u6ca1\u6709\u4e25\u683c\u8981\u6c42\u4f7f\u7528\u5b83\uff0c\u4f46\u8fd9\u662fJava\u4e2d\u88ab\u5e7f\u6cdb\u63a5\u53d7\u7684\u547d\u540d\u89c4\u8303\u3002\u4e00\u65e6\u4f60\u58f0\u660e\u4e86\u53d8\u91cf\uff0c\u4f60\u53ef\u4ee5\u5728\u65b9\u6cd5\u4e2d\u901a\u8fc7\u5f15\u7528\u6765\u4f7f\u7528\u5b83\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token keyword\">int<\/span> <mark>theAnswer<\/mark> <span class=\"token operator\">=<\/span> <span class=\"token number\">42<\/span><span class=\"token punctuation\">;<\/span>\r\n<span class=\"token class-name\">System<\/span><span class=\"token punctuation\">.<\/span>out<span class=\"token punctuation\">.<\/span><span class=\"token function\">println<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"The answer to all questions is \"<\/span> <span class=\"token operator\">+<\/span> <mark>theAnswer<\/mark><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>\u5728\u7b2c\u4e8c\u884c\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5185\u7f6e\u7684\u65b9\u6cd5println\u6765\u5c06theAnswer\u6253\u5370\u5230console\u63a7\u5236\u53f0\u4e2d\uff0c\u8be5\u65b9\u6cd5\u6765\u81ea\u4e8eSystem.out\u8fd9\u4e2a\u5305\u3002\u8fd9\u662f\u6d4b\u8bd5\u4e00\u4e2a\u53d8\u91cf\u662f\u5426\u6309\u9884\u671f\u58f0\u660e\u7684\u6700\u7b80\u5355\u7684\u65b9\u6cd5\u3002<\/p>\n<p>\u8981\u67e5\u770b\u6b64\u4ee3\u7801\u7684\u8fd0\u884c\u60c5\u51b5\uff0c\u8bf7\u4f7f\u7528Java Shell\u5de5\u5177\u3002\u5b89\u88c5Java\u540e\uff0c\u5728\u672c\u5730\u8ba1\u7b97\u673a\u4e0a\u6253\u5f00\u4e00\u4e2a\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\uff0c\u7136\u540e\u952e\u5165jshell\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"$\">jshell<\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u60a8\u7684\u8f93\u51fa\u5c06\u4e0e\u4ee5\u4e0b\u5185\u5bb9\u76f8\u4f3c\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>| Welcome to JShell &#8212; Version 11.0.16 | For an introduction type: \/help intro jshell&gt;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4f60\u53ef\u4ee5\u5c06\u8fd9\u4e2a\u6559\u7a0b\u4e2d\u7684\u4ee3\u7801\u793a\u4f8b\u7c98\u8d34\u5230\u63a7\u5236\u53f0\u4e2d\u3002\u5b8c\u6210\u540e\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u8f93\u5165\/exit\u547d\u4ee4\u9000\u51fajshell\u3002<\/p>\n<p>\u8981\u58f0\u660e\u548c\u4f7f\u7528 int\uff0c\u5728 jshell \u63a7\u5236\u53f0\u4e2d\u7c98\u8d34\u4e0b\u9762\u7684\u4ee3\u7801\u884c\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\">int <mark>theAnswer<\/mark> <span class=\"token operator\">=<\/span> <span class=\"token number\">42<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"jshell&gt;\">System.out.println<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8220;The answer to all questions is &#8220;<\/span> + <mark>theAnswer<\/mark><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u60a8\u5c06\u4f1a\u770b\u5230\u4ee5\u4e0b\u7684\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>theAnswer ==&gt; 42 The answer to all questions is 42<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8fd9\u4e2a\u8f93\u51fa\u8bc1\u5b9e\u4f60\u6b63\u786e\u5730\u5c06int\u7c7b\u578b\u7684\u53d8\u91cftheAnswer\u8bbe\u7f6e\u4e3a42\uff08theAnswer ==&gt; 42\uff09\u3002\u4f60\u8fd8\u6210\u529f\u5730\u901a\u8fc7\u5c06theAnswer\u4f20\u9012\u7ed9\u4e00\u4e2a\u65b9\u6cd5\u6765\u4f7f\u7528\u5b83\uff0c\u800c\u8be5\u65b9\u6cd5\u8f93\u51fa\u4e86\u9884\u671f\u7684\u53d8\u91cf\u503c\u3002<\/p>\n<h3>\u5e03\u5c14\u503c<br \/>\n\u8fd9\u662f\u6587\u7ae0\u300a\u7406\u89e3Java\u4e2d\u7684\u6570\u636e\u7c7b\u578b\u300b\u7684\u7b2c2\u90e8\u5206\uff08\u51715\u90e8\u5206\uff09\u3002<\/p>\n<p>\u5185\u5bb9\u7247\u6bb5: \u5e03\u5c14\u503c\u53ef\u4ee5\u662f\u771f\u6216\u8005\u5047\u3002\u5728Java\u4e2d\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u5e03\u5c14\u7c7b\u578b\u6765\u5b58\u50a8\u5b83\u4eec\u3002\u4f8b\u5982\uff0c\u8ba9\u6211\u4eec\u521b\u5efa\u4e00\u4e2a\u5e03\u5c14\u53d8\u91cf\u6765\u5224\u65adJava\u662f\u5426\u6709\u8da3\uff1a<\/p>\n<pre class=\"post-pre\"><code><mark><span class=\"token keyword\">boolean<\/span><\/mark> isJavaFun <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>\u4f60\u5c06\u53d8\u91cfisJavaFun\u5b9a\u4e49\u4e3atrue\u3002\u53e6\u4e00\u4e2a\u5e03\u5c14\u503c\u7684\u9009\u62e9\u662ffalse\u3002<\/p>\n<p>\u4f7f\u7528\u4e0a\u8ff0\u53d8\u91cf\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u65b9\u5f0f\u6253\u5370\u51fa\u53e5\u5b50&#8221;Java\u5f88\u6709\u8da3\uff1a\u771f&#8221;\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\">boolean <mark>isJavaFun<\/mark> <span class=\"token operator\">=<\/span> <span class=\"token boolean\">true<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"jshell&gt;\">System.out.println<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8220;Java is fun: &#8220;<\/span> + <mark>isJavaFun<\/mark><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5728jshell\u4e2d\u8fd0\u884c\u8fd9\u4e9b\u4ee3\u7801\u5c06\u4ea7\u751f\u4ee5\u4e0b\u8f93\u51fa:<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"\u8f93\u51fa\">\u8f93\u51fa<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>isJavaFun ==&gt; true Java is fun: true<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4e0eint\u793a\u4f8b\u7c7b\u4f3c\uff0cprintln\u65b9\u6cd5\u4f1a\u6253\u5370\u62ec\u53f7\u4e2d\u63d0\u4f9b\u7684\u53c2\u6570\u3002\u52a0\u53f7\uff08+\uff09\u5c06\u5b57\u7b26\u4e32&#8221;Java\u5f88\u6709\u8da3\uff1a&#8221;\u4e0e\u53d8\u91cfisJavaFun\u8fde\u63a5\u8d77\u6765\uff0c\u5b9e\u9645\u4e0a\u53ea\u662f\u4e00\u4e2a\u53c2\u6570 &#8211; \u5b57\u7b26\u4e32&#8221;Java\u5f88\u6709\u8da3\uff1atrue&#8221;\u3002<\/p>\n<h3>\u5b57\u7b26\u7c7b\u578b<\/h3>\n<p>\u4e3a\u4e86\u5b58\u50a8\u4e00\u4e2a\u5355\u4e2a\u7684\u5b57\u6bcd\u6570\u5b57\u5b57\u7b26\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528char\u3002\u4f8b\u5982\uff1a<\/p>\n<pre class=\"post-pre\"><code><mark><span class=\"token keyword\">char<\/span><\/mark> firstLetter <span class=\"token operator\">=<\/span> <span class=\"token char\">'a'<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>\u6ce8\u610f\u5230\u5b57\u6bcda\u88ab\u5355\u5f15\u53f7\u5305\u56f4\u3002\u5355\u5f15\u53f7\u53ea\u80fd\u7528\u4e8e\u5b57\u7b26\u503c\u3002\u800c\u53cc\u5f15\u53f7\u5219\u7528\u4e8e\u5b57\u7b26\u4e32\uff0c\u8fd9\u5c06\u5728\u540e\u9762\u5b66\u5230\u3002<\/p>\n<p>char\u8fd9\u79cd\u7c7b\u578b\u4f3c\u4e4e\u4e0d\u662f\u7279\u522b\u6709\u7528\uff0c\u56e0\u4e3a\u4f60\u4e0d\u592a\u53ef\u80fd\u9700\u8981\u5c06\u53d8\u91cf\u5206\u914d\u7ed9\u4e00\u4e2a\u5355\u4e2a\u5b57\u7b26\u3002\u7136\u800c\uff0cchar\u88ab\u7528\u4f5c\u5b57\u7b26\u4e32\u7c7b\uff08\u4f8b\u5982String\uff09\u7684\u6784\u5efa\u5757\uff0c\u800c\u8fd9\u4e9b\u7c7b\u57fa\u672c\u4e0a\u662fchar\u503c\u7684\u96c6\u5408\u3002<\/p>\n<p>\u6b63\u5982\u4f60\u5728\u672c\u8282\u4e2d\u6240\u770b\u5230\u7684\uff0c\u539f\u59cb\u7c7b\u578b\u53d8\u91cf\u7684\u58f0\u660e\u548c\u4f7f\u7528\u662f\u76f4\u89c2\u7684\uff0c\u56e0\u4e3a\u5b83\u4eec\u8868\u793a\u7b80\u5355\u7684\u503c\uff0c\u5982\u6574\u6570\u3002\u8fd9\u4e9b\u503c\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u65e0\u9700\u8fdb\u884c\u989d\u5916\u7684\u64cd\u4f5c\uff0c\u6bd4\u5982\u521b\u5efa\u5bf9\u8c61\u3001\u8c03\u7528\u65b9\u6cd5\u7b49\u7b49\u3002<\/p>\n<h2>\u5f15\u7528\u7c7b\u578b<\/h2>\n<p>\u5728\u8fd9\u4e2a\u7cfb\u5217\u7684\u7b2c\u4e00\u4e2a\u6559\u7a0b\u4e2d\uff0c\u4f60\u5b66\u5230\u4e86Java\u4ee3\u7801\u662f\u4ee5\u7c7b\u4e3a\u7ec4\u7ec7\u5355\u4f4d\u7684\uff0c\u8fd9\u4e9b\u7c7b\u88ab\u7528\u4f5c\u521b\u5efa\u5bf9\u8c61\u7684\u6a21\u677f\u3002\u5f53\u8fd9\u4e9b\u5bf9\u8c61\u88ab\u5206\u914d\u7ed9\u53d8\u91cf\u65f6\uff0c\u4f60\u662f\u5728\u6307\u5411\u6216\u5f15\u7528\u8fd9\u4e9b\u5bf9\u8c61\u3002\u5728\u8fd9\u4e9b\u60c5\u51b5\u4e0b\uff0c\u8fd9\u4e9b\u53d8\u91cf\u88ab\u79f0\u4e3a\u5f15\u7528\u7c7b\u578b\u3002\u8fd9\u4e9b\u53d8\u91cf\u4e5f\u88ab\u79f0\u4e3a\u975e\u57fa\u672c\u7c7b\u578b\uff0c\u56e0\u4e3a\u57fa\u672c\u7c7b\u578b\u53d8\u91cf\u4e0d\u80fd\u6307\u5411\u5bf9\u8c61\u3002<\/p>\n<p>\u5bf9\u8c61\u662f\u5f3a\u5927\u7684\uff0c\u56e0\u4e3a\u5b83\u4eec\u5177\u6709\u5148\u8fdb\u7684\u5c5e\u6027\u5e76\u4e14\u80fd\u591f\u5728\u89e6\u53d1\u5b83\u4eec\u7684\u65b9\u6cd5\u65f6\u8fdb\u884c\u64cd\u4f5c\u3002\u7136\u800c\uff0c\u5982\u679c\u6ca1\u6709\u6307\u5411\u8fd9\u4e9b\u5bf9\u8c61\u7684\u53d8\u91cf\uff0c\u8fd9\u4e9b\u5bf9\u8c61\u5c31\u65e0\u6cd5\u8bbf\u95ee\u4e14\u51e0\u4e4e\u65e0\u6cd5\u4f7f\u7528\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5f15\u7528\u7c7b\u578b\u53d8\u91cf\u5bf9\u4e8eJava\u548c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u6765\u8bf4\u662f\u81f3\u5173\u91cd\u8981\u7684\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">\u6ce8\u610f\uff1a<\/p>\n<p>\u5f15\u7528\u7c7b\u578b\u6307\u7684\u662f\u4ece\u7c7b\u521b\u5efa\u7684\u5bf9\u8c61\u3002\u4e3a\u4e86\u907f\u514d\u6df7\u6dc6\uff0c\u4ee5\u4e0b\u793a\u4f8b\u4e2d\u7684\u5f15\u7528\u7c7b\u578b\u548c\u521b\u5efa\u7684\u5bf9\u8c61\u5c06\u662f\u76f8\u540c\u7684\u7c7b\u3002<br \/>\n\u7136\u800c\uff0c\u5728\u590d\u6742\u7684\u7a0b\u5e8f\u4e2d\uff0c\u8fd9\u79cd\u60c5\u51b5\u5f88\u5c11\u53d1\u751f\u3002\u5728Java\u4e2d\uff0c\u63a5\u53e3\u662f\u5bf9\u7279\u5b9a\u884c\u4e3a\u7684\u8981\u6c42\u7ec4\uff0c\u8fd9\u4e9b\u8981\u6c42\u53ef\u4ee5\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u7c7b\u6765\u6ee1\u8db3\u3002\u6ee1\u8db3\u63a5\u53e3\u8981\u6c42\u7684\u7c7b\u88ab\u79f0\u4e3a\u5b9e\u73b0\u4e86\u8be5\u63a5\u53e3\u3002\u56e0\u6b64\uff0c\u5728\u590d\u6742\u7684\u7a0b\u5e8f\u4e2d\uff0c\u5e38\u5e38\u4f7f\u7528\u63a5\u53e3\u7684\u5f15\u7528\u7c7b\u578b\u6765\u58f0\u660e\u53d8\u91cf\u3002\u8fd9\u6837\uff0c\u60a8\u53ef\u4ee5\u6307\u5b9a\u53d8\u91cf\u5e94\u8be5\u5c55\u793a\u7684\u884c\u4e3a\uff0c\u800c\u65e0\u9700\u5c06\u5176\u4e0e\u5177\u4f53\u7684\u884c\u4e3a\u5b9e\u73b0\u7ed1\u5b9a\u5728\u4e00\u8d77\u3002\u8fd9\u4f7f\u60a8\u80fd\u591f\u8f7b\u677e\u66f4\u6539\u53d8\u91cf\u6307\u5411\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u800c\u65e0\u9700\u66f4\u6539\u53d8\u91cf\u7684\u4f7f\u7528\u65b9\u5f0f\u3002\u8fd9\u4e2a\u590d\u6742\u7684\u6982\u5ff5\u662f\u7ee7\u627f\u548c\u591a\u6001\u6027\u66f4\u9ad8\u7ea7\u8bdd\u9898\u7684\u4e00\u90e8\u5206\uff0c\u5c06\u5728\u6211\u4eec\u7684Java\u7cfb\u5217\u4e2d\u8fdb\u884c\u5355\u72ec\u7684\u6559\u7a0b\u3002\u867d\u7136\u539f\u59cb\u7c7b\u578b\u53ea\u6709\u51e0\u79cd\uff0c\u4f46\u5f15\u7528\u7c7b\u578b\u51e0\u4e4e\u6ca1\u6709\u9650\u5236\uff0c\u56e0\u4e3a\u7c7b\uff08\u548c\u63a5\u53e3\uff09\u7684\u6570\u91cf\u6ca1\u6709\u9650\u5236\uff0c\u6bcf\u4e2a\u7c7b\u4ee3\u8868\u4e00\u4e2a\u5f15\u7528\u7c7b\u578b\u3002Java\u4e2d\u6709\u8bb8\u591a\u5185\u7f6e\u7c7b\u63d0\u4f9b\u57fa\u672c\u529f\u80fd\u3002\u6700\u5e38\u7528\u7684\u7c7b\u53ef\u4ee5\u5728\u6838\u5fc3java.lang\u5305\u4e2d\u627e\u5230\u3002\u5728\u672c\u8282\u4e2d\uff0c\u60a8\u5c06\u4f1a\u5bf9\u5176\u4e2d\u4e00\u4e9b\u8fdb\u884c\u590d\u4e60\u3002<\/p>\n<\/div>\n<h3>\u5b57\u7b26\u4e32\u7c7b<\/h3>\n<p>\u5b57\u7b26\u4e32\u7c7b\u8868\u793a\u7531\u5b57\u7b26\u7ec4\u6210\u7684\u5b57\u7b26\u4e32\u7684\u7ec4\u5408\u3002\u8981\u58f0\u660e\u4e00\u4e2a\u5b57\u7b26\u4e32\u6216\u4efb\u4f55\u5176\u4ed6\u5f15\u7528\u7c7b\u578b\u53d8\u91cf\uff0c\u9996\u5148\u8981\u6307\u5b9a\u5176\u7c7b\u578b\uff0c\u7136\u540e\u662f\u53d8\u91cf\u540d\u79f0\u3002\u5728\u6b64\u4e4b\u540e\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528\u7b49\u53f7\u4e3a\u5176\u8d4b\u503c\u3002\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u5b83\u4e0e\u4f7f\u7528\u57fa\u672c\u7c7b\u578b\u7c7b\u4f3c\u3002\u7136\u800c\uff0c\u5f15\u7528\u7c7b\u578b\u6307\u5411\u5bf9\u8c61\uff0c\u6240\u4ee5\u5982\u679c\u5c1a\u672a\u521b\u5efa\u5bf9\u8c61\uff0c\u5219\u5fc5\u987b\u521b\u5efa\u5bf9\u8c61\u3002\u4ee5\u4e0b\u662f\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<pre class=\"post-pre\"><code><mark><span class=\"token class-name\">String<\/span><\/mark> hello <span class=\"token operator\">=<\/span> <span class=\"token keyword\">new<\/span> <span class=\"token class-name\">String<\/span><span class=\"token punctuation\">(<\/span><span class=\"token string\">\"Hello\"<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>hello\u662f\u4e00\u4e2a\u5177\u6709\u5f15\u7528\u7c7b\u578bString\u7684\u53d8\u91cf\u540d\u3002\u4f60\u5c06\u5b83\u5206\u914d\u7ed9\u4e00\u4e2a\u65b0\u7684String\u5bf9\u8c61\u3002\u65b0\u7684String\u5bf9\u8c61\u662f\u4f7f\u7528new\u5173\u952e\u5b57\u548c\u7c7b\u540dString\u521b\u5efa\u7684\u3002String\u7c7b\u4ee5\u5927\u5199\u5b57\u6bcd\u5f00\u5934\u3002\u6309\u7167\u7ea6\u5b9a\uff0c\u6240\u6709\u7c7b\u548c\u56e0\u6b64\u5f15\u7528\u7c7b\u578b\u90fd\u4ee5\u5927\u5199\u5b57\u6bcd\u5f00\u5934\u3002<\/p>\n<p>\u6bcf\u4e2a\u7c7b\u90fd\u6709\u4e00\u4e2a\u7279\u6b8a\u7684\u65b9\u6cd5\u53eb\u505a\u6784\u9020\u51fd\u6570\uff0c\u7528\u4e8e\u521b\u5efa\u65b0\u7684\u5bf9\u8c61\u3002\u53ef\u4ee5\u901a\u8fc7\u5728\u7c7b\u540d\u540e\u9762\u52a0\u4e0a\u62ec\u53f7()\u6765\u8c03\u7528\u8be5\u6784\u9020\u51fd\u6570\u3002\u6784\u9020\u51fd\u6570\u53ef\u4ee5\u63a5\u53d7\u53c2\u6570\uff0c\u5c31\u50cf\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u53c2\u6570&#8221;Hello&#8221;\u88ab\u5e94\u7528\u4e8eString\u7c7b\u7684\u6784\u9020\u51fd\u6570\u3002<\/p>\n<p>\u4e3a\u4e86\u786e\u8ba4hello\u53d8\u91cf\u7684\u884c\u4e3a\u662f\u5426\u5982\u9884\u671f\u4e00\u6837\uff0c\u53ef\u4ee5\u5c06\u5b83\u518d\u6b21\u4f20\u9012\u7ed9println\u65b9\u6cd5\uff0c\u50cf\u8fd9\u6837\u64cd\u4f5c\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\"><mark>String<\/mark> hello <span class=\"token operator\">=<\/span> new String<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8220;Hello&#8221;<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"jshell&gt;\">System.out.println<span class=\"token punctuation\">(<\/span>hello<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5728jshell\u4e2d\u8fd0\u884c\u8fd9\u4e9b\u4ee3\u7801\u5c06\u4ea7\u751f\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"\u8f93\u51fa\">\u8f93\u51fa<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>hello ==&gt; &#8220;Hello&#8221; Hello<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u8fd9\u6b21\u8f93\u51fa\u786e\u8ba4\u53d8\u91cfhello\u88ab\u8bbe\u7f6e\u4e3a&#8221;Hello&#8221;\u3002\u4e4b\u540e\uff0c\u540c\u4e00\u4e2a&#8221;Hello&#8221;\u88ab\u6253\u5370\u5728\u65b0\u7684\u4e00\u884c\u4e0a\uff0c\u786e\u8ba4\u4e86println()\u65b9\u6cd5\u5df2\u5904\u7406\u5b83\u3002<\/p>\n<h3>\u5c01\u88c5\u7c7b<\/h3>\n<p>\u5728\u4e0a\u4e00\u8282\u4e2d\uff0c\u4f60\u4f7f\u7528\u4e86\u9891\u7e41\u4f7f\u7528\u7684String\u5f15\u7528\u7c7b\u578b\u3002\u5176\u4ed6\u5e38\u89c1\u7684\u5f15\u7528\u7c7b\u578b\u662f\u6240\u8c13\u7684\u539f\u59cb\u7c7b\u578b\u5305\u88c5\u5668\u3002\u5305\u88c5\u5668\u7c7b\u5305\u88c5\u6216\u5305\u542b\u539f\u59cb\u6570\u636e\uff0c\u56e0\u6b64\u5f97\u540d\u3002\u6240\u6709\u539f\u59cb\u7c7b\u578b\u90fd\u6709\u5305\u88c5\u5668\u5bf9\u5e94\u7c7b\uff0c\u4ee5\u4e0b\u662f\u4e00\u4e9b\u4f8b\u5b50\uff1a<\/p>\n<ul class=\"post-ul\">\n<li>Integer: To wrap int values.<\/li>\n<li>Character: To wrap char values.<\/li>\n<li>Boolean: To wrap boolean values.<\/li>\n<\/ul>\n<p>\u8fd9\u4e9b\u5305\u88c5\u5668\u7684\u5b58\u5728\u662f\u4e3a\u4e86\u5c06\u7b80\u5355\u7684\u539f\u59cb\u503c\u5347\u7ea7\u4e3a\u529f\u80fd\u5f3a\u5927\u7684\u5bf9\u8c61\u3002\u6bcf\u4e2a\u5305\u88c5\u5668\u90fd\u6709\u4e0e\u5176\u8bbe\u8ba1\u7528\u4e8e\u5b58\u50a8\u7684\u503c\u76f8\u5173\u7684\u73b0\u6210\u65b9\u6cd5\u53ef\u4f9b\u4f7f\u7528\u3002<\/p>\n<p>\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u4f60\u5c06\u8981\u63a2\u7d22\u6574\u6570\u3002\u5728\u524d\u9762\u4e00\u8282\u4e2d\uff0c\u4f60\u4f7f\u7528new\u5173\u952e\u5b57\u521b\u5efa\u4e86\u4e00\u4e2a\u5b57\u7b26\u4e32\u5bf9\u8c61\u3002\u7136\u800c\uff0c\u6709\u4e9b\u7c7b\u63d0\u4f9b\u751a\u81f3\u9f13\u52b1\u4f7f\u7528\u7279\u6b8a\u65b9\u6cd5\u6765\u83b7\u53d6\u5bf9\u8c61\uff0c\u800cInteger\u5c31\u662f\u5176\u4e2d\u4e4b\u4e00\u3002\u5728\u6574\u6570\u7684\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528\u7279\u6b8a\u65b9\u6cd5\u4e3b\u8981\u662f\u4e3a\u4e86\u8d44\u6e90\u4f18\u5316\uff0c\u4f46\u5728\u5176\u4ed6\u60c5\u51b5\u4e0b\uff0c\u53ef\u80fd\u662f\u4e3a\u4e86\u7b80\u5316\u590d\u6742\u5bf9\u8c61\u7684\u6784\u9020\u3002<\/p>\n<p>\u5728\u4e0b\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u60a8\u53ef\u4ee5\u4f7f\u7528valueOf\u65b9\u6cd5\u521b\u5efa\u4e00\u4e2a\u540d\u4e3atheAnswer\u7684\u6574\u6570\u53d8\u91cf\uff0c\u5e76\u5c06\u5176\u503c\u8bbe\u7f6e\u4e3a42\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\"><mark>Integer<\/mark> theAnswer <span class=\"token operator\">=<\/span> Integer.valueOf<span class=\"token punctuation\">(<\/span><span class=\"token number\">42<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"jshell&gt;\">System.out.println<span class=\"token punctuation\">(<\/span>theAnswer<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5728jshell\u4e2d\uff0c\u4f60\u5c06\u83b7\u5f97\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>theAnswer ==&gt; 42 42<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u901a\u8fc7\u8c03\u7528Integer\u7684valueOf(42)\u65b9\u6cd5\uff0c\u4f60\u6307\u793aJava\u7ed9\u4f60\u4e00\u4e2a\u5177\u6709\u8fd9\u4e2a\u503c\u7684\u5bf9\u8c61\u3002\u5728\u5e55\u540e\uff0cJava\u4f1a\u68c0\u67e5\u5b83\u7684\u7f13\u5b58\u4e2d\u662f\u5426\u5df2\u7ecf\u6709\u4e00\u4e2a\u5177\u6709\u8fd9\u4e2a\u503c\u7684\u5bf9\u8c61\u3002\u5982\u679c\u6709\uff0c\u90a3\u4e48\u8fd9\u4e2a\u5bf9\u8c61\u5c06\u4e0etheAnswer\u53d8\u91cf\u5173\u8054\u8d77\u6765\u3002\u5982\u679c\u6ca1\u6709\uff0c\u5c06\u4e3atheAnswer\u53d8\u91cf\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5bf9\u8c61\u3002<\/p>\n<p>\u51fa\u4e8e\u6027\u80fd\u8003\u8651\uff0c\u8bb8\u591a\u5185\u7f6e\u7c7b\u63d0\u4f9b\u4e86\u8fd9\u4e9b\u65b9\u6cd5\uff0c\u5e76\u4e14\u5982\u679c\u4e0d\u662f\u5f3a\u5236\u8981\u6c42\uff0c\u4e5f\u5efa\u8bae\u4f7f\u7528\u5b83\u4eec\u3002\u5728Integer\u7684\u60c5\u51b5\u4e0b\uff0c\u60a8\u4ecd\u7136\u53ef\u4ee5\u4f7f\u7528new\u5173\u952e\u5b57\u521b\u5efa\u5bf9\u8c61\uff0c\u4f46\u662f\u4f1a\u6536\u5230\u4e00\u4e2a\u5f03\u7528\u8b66\u544a\u3002<\/p>\n<p>\u9664\u4e86String\u548c\u5305\u88c5\u7c7b\u4e4b\u5916\uff0c\u8fd8\u6709\u5176\u4ed6\u4e00\u4e9b\u6709\u7528\u7684\u5185\u7f6e\u5f15\u7528\u7c7b\u578b\u53ef\u4ee5\u5728java.lang\u5305\u6982\u8ff0\u4e2d\u627e\u5230\u3002\u8981\u5b8c\u5168\u7406\u89e3\u8fd9\u4e9b\u66f4\u9ad8\u7ea7\u7684\u5f15\u7528\u7c7b\u578b\uff0c\u9700\u8981\u989d\u5916\u7684\u89e3\u91ca\u6216\u5148\u524d\u7684\u77e5\u8bc6\u3002\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u6211\u4eec\u5c06\u5728\u6211\u4eec\u7684\u4e0b\u4e00\u4e2aJava\u7cfb\u5217\u6559\u7a0b\u4e2d\u4ecb\u7ecd\u5176\u4e2d\u4e00\u4e9b\u7684\u539f\u56e0\u3002<\/p>\n<h2>\u5b57\u9762\u7684\u5b57\u9762\u503c\u4ee3\u8868\u53ef\u4ee5\u76f4\u63a5\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528\u7684\u56fa\u5b9a\u503c\uff0c\u56e0\u6b64\u53ef\u4ee5\u5206\u914d\u7ed9\u539f\u59cb\u7c7b\u578b\u548c\u5f15\u7528\u7c7b\u578b\u3002\u6709\u51e0\u79cd\u7c7b\u578b\u7684\u5b57\u9762\u503c\uff0c\u53ef\u4ee5\u6309\u4ee5\u4e0b\u65b9\u5f0f\u8fdb\u884c\u5206\u7c7b\u3002<\/p>\n<h3>\u539f\u59cb\u7c7b\u578b\u5b57\u9762\u91cf\u4f60\u5df2\u7ecf\u5728\u539f\u59cb\u7c7b\u578b\u7684\u90e8\u5206\u4e2d\u4f7f\u7528\u4e86\u4e00\u4e9b\u5b57\u9762\u503c\u3002\u5bf9\u4e8e\u6bcf\u79cd\u539f\u59cb\u7c7b\u578b\uff0c\u90fd\u6709\u76f8\u5e94\u7684\u5b57\u9762\u503c\uff0c\u4f8b\u5982\u6211\u4eec\u7684\u4f8b\u5b50\u4e2d\u768442\uff0c&#8217;a&#8217;\u548ctrue\u3002\u50cf42\u8fd9\u6837\u7684\u6574\u6570\u88ab\u79f0\u4e3a\u6574\u6570\u5b57\u9762\u503c\u3002\u540c\u6837\uff0c\u50cf&#8217;a&#8217;\u8fd9\u6837\u7684\u5b57\u7b26\u88ab\u79f0\u4e3a\u5b57\u7b26\u5b57\u9762\u503c\uff0c\u800ctrue\u548cfalse\u88ab\u79f0\u4e3a\u5e03\u5c14\u5b57\u9762\u503c\u3002<\/p>\n<p>\u539f\u59cb\u7c7b\u578b\u5b57\u9762\u91cf\u4e5f\u53ef\u4ee5\u7528\u6765\u521b\u5efa\u5f15\u7528\u7c7b\u578b\u7684\u503c\u3002\u4f7f\u7528int\u5b57\u9762\u91cf\u521b\u5efa\u4e86\u4e00\u4e2aInteger\u5bf9\u8c61\uff0c\u5e76\u4e14\u4f7f\u7528\u4ee3\u7801Integer.valueOf(42)\u3002\u8fd8\u6709\u4e00\u79cd\u7b80\u5316\u7684\u65b9\u6cd5\uff0c\u53ef\u4ee5\u76f4\u63a5\u8d4b\u503c\u7ed9\u53d8\u91cf\uff0c\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n<pre class=\"post-pre\"><code><span class=\"token class-name\">Integer<\/span> theAnswer <span class=\"token operator\">=<\/span> <mark><span class=\"token number\">42<\/span><\/mark><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>42 \u662f\u4e00\u4e2a\u6574\u578b\u5b57\u9762\u503c\uff0c\u5c31\u50cf\u4efb\u4f55\u5176\u4ed6\u6574\u6570\u4e00\u6837\uff0c\u4f60\u53ef\u4ee5\u5c06\u5176\u76f4\u63a5\u8d4b\u503c\u7ed9theAnswer\u53d8\u91cf\uff0c\u65e0\u9700\u4efb\u4f55\u5176\u4ed6\u8bed\u53e5\u3002\u8fd9\u79cd\u58f0\u660e\u6574\u6570\u7684\u65b9\u5f0f\u5f88\u5e38\u89c1\uff0c\u56e0\u4e3a\u5b83\u5f88\u65b9\u4fbf\u3002<\/p>\n<p>\u8fd9\u79cd\u901f\u8bb0\u65b9\u6cd5\u5bf9\u4e8e\u5176\u4ed6\u57fa\u672c\u7c7b\u578b\u5b57\u9762\u503c\u4ee5\u53ca\u5b83\u4eec\u5bf9\u5e94\u7684\u5f15\u7528\u7c7b\u578b\uff08\u4f8b\u5982\u5e03\u5c14\u503c\uff09\u4e5f\u540c\u6837\u9002\u7528\u3002<\/p>\n<pre class=\"post-pre\"><code><span class=\"token class-name\">Boolean<\/span> isFun <span class=\"token operator\">=<\/span> <mark><span class=\"token boolean\">true<\/span><\/mark><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>true \u662f\u5b57\u9762\u91cf\uff0c\u76f4\u63a5\u8d4b\u503c\u7ed9\u4e86\u7c7b\u578b\u4e3a Boolean \u7684 isFun \u53d8\u91cf\u3002\u4e5f\u6709\u4e00\u4e2a false \u5b57\u9762\u91cf\uff0c\u53ef\u4ee5\u4ee5\u540c\u6837\u7684\u65b9\u5f0f\u8d4b\u503c\u3002<\/p>\n<h3>\u5b57\u7b26\u4e32\u5b57\u9762\u91cf\u8fd8\u6709\u4e00\u4e2a\u7279\u6b8a\u7684\u5b57\u9762\u503c\u53ef\u4ee5\u7528\u4e8e\u5b57\u7b26\u4e32\u5f15\u7528\u7c7b\u578b\uff0c\u901a\u8fc7\u53cc\u5f15\u53f7\u62ec\u4f4f\u5176\u503c\u6765\u8bc6\u522b\u3002\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0c\u5b83\u7684\u503c\u662f\u201c\u4f60\u597d\uff0c\u4e16\u754c\uff01\u201d<\/p>\n<pre class=\"post-pre\"><code><span class=\"token class-name\">String<\/span> helloWorld <span class=\"token operator\">=<\/span> <mark><span class=\"token string\">\"Hello, World!\"<\/span><\/mark><span class=\"token punctuation\">;<\/span>\r\n<\/code><\/pre>\n<p>\u4f7f\u7528\u5b57\u9762\u91cf\u66f4\u7b80\u5355\u548c\u66f4\u77ed\uff0c\u8fd9\u5c31\u662f\u8bb8\u591a\u7a0b\u5e8f\u5458\u7684\u9996\u9009\u3002\u7136\u800c\uff0c\u5728\u5f15\u7528\u7c7b\u578b\u7684\u90e8\u5206\u4e2d\uff0c\u60a8\u4ecd\u7136\u53ef\u4ee5\u58f0\u660e\u4e00\u4e2a\u65b0\u7684String\u5bf9\u8c61\u7684String\u53d8\u91cf\uff0c\u5c31\u50cf\u60a8\u5df2\u7ecf\u505a\u8fc7\u7684\u90a3\u6837\u3002<\/p>\n<h3>&#8220;\u7a7a\u503c\u5b57\u9762\u91cf&#8221;\u8fd8\u6709\u4e00\u4e2a\u91cd\u8981\u7684\u6587\u5b57\uff0c\u5c31\u662fnull\uff0c\u5b83\u4ee3\u8868\u4e86\u503c\u7684\u7f3a\u5931\u6216\u5bf9\u8c61\u7684\u4e0d\u5b58\u5728\u3002null\u5141\u8bb8\u60a8\u521b\u5efa\u4e00\u4e2a\u5f15\u7528\u7c7b\u578b\u5e76\u5c06\u5176\u6307\u5411null\uff0c\u800c\u4e0d\u662f\u6307\u5411\u4e00\u4e2a\u5bf9\u8c61\u3002null\u53ef\u4ee5\u7528\u4e8e\u6240\u6709\u5f15\u7528\u7c7b\u578b\uff0c\u4f46\u4e0d\u80fd\u7528\u4e8e\u4efb\u4f55\u57fa\u672c\u7c7b\u578b\u3002<\/p>\n<p>\u5728\u4f7f\u7528\u7a7a\u5b57\u9762\u503c\u65f6\u6709\u4e00\u4e2a\u6ce8\u610f\u4e8b\u9879\uff1a\u4f60\u53ef\u4ee5\u7528\u5b83\u6765\u58f0\u660e\u53d8\u91cf\uff0c\u4f46\u662f\u5728\u91cd\u65b0\u8d4b\u503c\u4e00\u4e2a\u9002\u5f53\u7684\u3001\u975e\u7a7a\u7684\u503c\u4e4b\u524d\uff0c\u4f60\u4e0d\u80fd\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\u3002\u5982\u679c\u4f60\u5c1d\u8bd5\u4f7f\u7528\u4e00\u4e2a\u5177\u6709\u7a7a\u503c\u7684\u5f15\u7528\u7c7b\u578b\u53d8\u91cf\uff0c\u4f60\u4f1a\u9047\u5230\u9519\u8bef\u3002\u8fd9\u91cc\u6709\u4e00\u4e2a\u4f8b\u5b50\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\">String initiallyNullString <span class=\"token operator\">=<\/span> <mark>null<\/mark><span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"jshell&gt;\">System.out.println<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8220;The class name is: &#8220;<\/span> + initiallyNullString.getClass<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">))<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5f53\u60a8\u5c1d\u8bd5\u5728jshell\u4e2d\u8fd0\u884c\u6b64\u4ee3\u7801\u65f6\uff0c\u60a8\u5c06\u770b\u5230\u7c7b\u4f3c\u4e8e\u4ee5\u4e0b\u9519\u8bef\u7684\u9519\u8bef\u63d0\u793a\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">Output<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>initiallyNullString ==&gt; null | Exception java.lang.NullPointerException | at (#4:1)<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u6839\u636e\u60a8\u7684\u64cd\u4f5c\u7cfb\u7edf\u548cJava\u7248\u672c\uff0c\u60a8\u7684\u8f93\u51fa\u53ef\u80fd\u4f1a\u6709\u6240\u4e0d\u540c\u3002<\/p>\n<p>\u56e0\u4e3a\u60a8\u8bd5\u56fe\u5728\u6700\u521d\u4e3a\u7a7a\u7684\u5bf9\u8c61 initiallyNullString \u4e0a\u8c03\u7528\u8fd4\u56de\u7c7b\u540d\u7684 String \u65b9\u6cd5 getClass()\uff0c\u6240\u4ee5\u629b\u51fa\u4e86 java.lang.NullPointerException \u9519\u8bef\u3002<\/p>\n<div class=\"post-conf-note\">\n<p class=\"post-conf-desc\">Note<\/p>\n<div>\u8bf7\u6ce8\u610f\uff1a\u4e3a\u4e86\u7b80\u5316\uff0c\u6211\u4eec\u5c06java.lang.NullPointerException\u79f0\u4e3a\u9519\u8bef\uff0c\u5c3d\u7ba1\u4ece\u6280\u672f\u4e0a\u8bb2\u5b83\u662f\u4e00\u4e2a\u5f02\u5e38\u3002\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8e\u5f02\u5e38\u548c\u9519\u8bef\u7684\u5185\u5bb9\uff0c\u8bf7\u67e5\u770bJava\u6559\u7a0b\u4e2d\u7684\u5f02\u5e38\u5904\u7406\u90e8\u5206\u3002<\/p>\n<p>\u8981\u89e3\u51b3\u8fd9\u4e2a\u9519\u8bef\uff0c\u4f60\u9700\u8981\u50cf\u8fd9\u6837\u91cd\u65b0\u8d4b\u503cinitiallyNullString\u7684\u503c\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\">String initiallyNullString <span class=\"token operator\">=<\/span> null<span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"jshell&gt;\"><mark>initiallyNullString <span class=\"token operator\">=<\/span> <span class=\"token string\">&#8220;not null any longer&#8221;<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<li data-prefix=\"jshell&gt;\">System.out.println<span class=\"token punctuation\">(<\/span><span class=\"token string\">&#8220;The class name is: &#8220;<\/span> + initiallyNullString.getClass<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u65b0\u7684\u4fee\u590d\u8fc7\u7684\u4ee3\u7801\u5c06\u6253\u5370\u51fa\u4ee5\u4e0b\u8f93\u51fa\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>initiallyNullString ==&gt; null initiallyNullString ==&gt; &#8220;not null any longer&#8221; The class name is: class java.lang.String<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4ee5\u4e0a\u8f93\u51fa\u663e\u793a\u4e86initiallyNullString\u6700\u521d\u4e3anull\uff0c\u7136\u540e\u53d8\u6210\u4e86\u4e00\u4e2a\u5305\u542b&#8221;\u4e0d\u518d\u662fnull&#8221;\u7684\u65b0\u5b57\u7b26\u4e32\u5bf9\u8c61\u3002\u63a5\u4e0b\u6765\uff0c\u5f53\u5728\u5b9e\u4f8b\u5316\u5bf9\u8c61\u4e0a\u8c03\u7528\u65b9\u6cd5getClass()\u65f6\uff0c\u4f60\u4f1a\u5f97\u5230java.lang.String\uff0c\u5176\u4e2dString\u662f\u7c7b\u540d\uff0cjava.lang\u662f\u5b83\u7684\u5305\u540d\u3002\u6700\u540e\uff0c\u6253\u5370\u51fa\u4e00\u4e2a\u5b8c\u6574\u800c\u6709\u610f\u4e49\u7684\u6d88\u606f\uff1a&#8221;\u7c7b\u540d\u662f\uff1aclass java.lang.String&#8221;\u3002<\/p>\n<p>\u8fd9\u79cd\u5bf9\u7a7a\u503c\u7684\u58f0\u660e\u5728\u65e7\u4ee3\u7801\u4e2d\u66f4\u5e38\u89c1\u3002\u5b83\u4eec\u88ab\u7528\u6765\u5148\u521b\u5efa\u4e00\u4e2a\u53d8\u91cf\uff0c\u7136\u540e\u5728\u7a0d\u540e\u5206\u914d\u5b83\u7684\u771f\u5b9e\u503c\uff0c\u901a\u5e38\u901a\u8fc7\u4e00\u4e9b\u786e\u5b9a\u540e\u8005\u7684\u903b\u8f91\u3002\u7136\u800c\uff0c\u81ea\u4eceJava 8\u7248\u672c\u4e4b\u540e\uff0c\u5f15\u5165\u4e86\u4e00\u79cd\u540d\u4e3aOptional\u7684\u65b0\u7684\u5f15\u7528\u7c7b\u578b\uff0c\u5bf9\u4e8e\u4e4b\u524d\u4f7f\u7528null\u7684\u60c5\u51b5\u66f4\u52a0\u5408\u9002\u3002<\/p>\n<h2>\u5c40\u90e8\u53d8\u91cf\u7c7b\u578b\u63a8\u65ad<\/h2>\n<p>\u5230\u76ee\u524d\u4e3a\u6b62\uff0c\u60a8\u4e00\u76f4\u5728\u4f7f\u7528Java\u4e2d\u7684\u4e00\u4e9b\u5e38\u89c1\u6570\u636e\u7c7b\u578b\u6765\u5b9a\u4e49\u53d8\u91cf\u3002\u7136\u800c\uff0cJava 10\u5f15\u5165\u4e86\u4e00\u9879\u540d\u4e3a\u672c\u5730\u53d8\u91cf\u7c7b\u578b\u63a8\u65ad\u7684\u65b0\u529f\u80fd\uff0c\u5141\u8bb8\u60a8\u5728\u65b0\u53d8\u91cf\u524d\u4f7f\u7528\u5173\u952e\u5b57var\u3002\u901a\u8fc7\u8fd9\u4e2a\u529f\u80fd\uff0cJava\u5c06\u4ece\u672c\u5730\u4e0a\u4e0b\u6587\u4e2d\u63a8\u65ad\uff08\u4e5f\u5c31\u662f\u81ea\u52a8\u731c\u6d4b\uff09\u6570\u636e\u7c7b\u578b\u3002\u7c7b\u578b\u63a8\u65ad\u5b58\u5728\u4e89\u8bae\uff0c\u56e0\u4e3a\u5b83\u4e0e\u5148\u524d\u89e3\u91ca\u7684\u53d8\u91cf\u5b9a\u4e49\u7684\u5197\u957f\u5f62\u6210\u5bf9\u6bd4\u3002\u8fd9\u79cd\u529f\u80fd\u7684\u4f18\u7f3a\u70b9\u662f\u6709\u4e89\u8bae\u7684\uff0c\u4f46\u4e8b\u5b9e\u662f\uff0c\u5176\u4ed6\u9759\u6001\u7c7b\u578b\u8bed\u8a00\uff0c\u5982C++\uff0c\u652f\u6301\u7c7b\u578b\u63a8\u65ad\u3002<\/p>\n<p>\u65e0\u8bba\u5982\u4f55\uff0c\u7c7b\u578b\u63a8\u65ad\u65e0\u6cd5\u5b8c\u5168\u53d6\u4ee3\u6570\u636e\u7c7b\u578b\u7684\u4f7f\u7528\uff0c\u56e0\u4e3a\u5b83\u4ec5\u9002\u7528\u4e8e\u5c40\u90e8\u53d8\u91cf\uff0c\u5373\u65b9\u6cd5\u5185\u7684\u53d8\u91cf\u3002\u8ba9\u6211\u4eec\u4ee5\u4e00\u4e2avar\u7684\u793a\u4f8b\u6765\u770b\u4e00\u4e0b\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\"><mark>var<\/mark> hello <span class=\"token operator\">=<\/span> <span class=\"token string\">&#8220;Hello&#8221;<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<li data-prefix=\"jshell&gt;\">System.out.println<span class=\"token punctuation\">(<\/span>hello<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u4f60\u4f7f\u7528var\u5173\u952e\u5b57\u58f0\u660e\u53d8\u91cfhello\uff0c\u4ee5\u4fbf\u6307\u793aJava\u68c0\u6d4b\u5176\u6570\u636e\u7c7b\u578b\u3002\u4e4b\u540e\uff0c\u4f60\u4ee5\u901a\u5e38\u7684\u65b9\u5f0f\u5c06\u5176\u6253\u5370\u5230\u63a7\u5236\u53f0\u4e2d\uff0c\u4ee5\u786e\u8ba4\u5b83\u6309\u9884\u671f\u5de5\u4f5c\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>hello ==&gt; &#8220;Hello&#8221; Hello<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u53ea\u8981\u4f60\u7684Java\u5b89\u88c5\uff08\u66f4\u5177\u4f53\u5730\u8bf4\uff0c\u662fJDK\uff09\u572810\u7248\u672c\u4ee5\u4e0a\uff0c\u8fd9\u4e2a\u793a\u4f8b\u5c31\u4f1a\u8fd0\u884c\u3002\u65e7\u7248\u672c\u4e0d\u652f\u6301var\u5173\u952e\u5b57\u3002<\/p>\n<p>\u7c7b\u578b\u63a8\u65ad\u53d1\u751f\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\uff0c\u4e5f\u5c31\u662f\u5728\u4f60\u7f16\u8bd1\u4ee3\u7801\u4e4b\u65f6\u3002\u7f16\u8bd1\u8fc7\u7a0b\u5c06\u7eaf\u6587\u672c\u6e90\u4ee3\u7801\u8f6c\u6362\u4e3a\u673a\u5668\u4ee3\u7801\uff0c\u5e76\u5e94\u7528\u5404\u79cd\u4f18\u5316\uff0c\u5305\u62ec\u7c7b\u578b\u63a8\u65ad\u3002\u8fd9\u786e\u4fdd\u4e86\u6709\u8db3\u591f\u7684\u7cfb\u7edf\u5185\u5b58\u4f9b\u7c7b\u578b\u63a8\u65ad\u7684\u53d8\u91cf\u4f7f\u7528\u3002\u56e0\u6b64\uff0c\u7f16\u8bd1\u540e\u8fd0\u884c\u7684\u673a\u5668\u4ee3\u7801\u662f\u5b8c\u5168\u4f18\u5316\u7684\uff0c\u5c31\u50cf\u4f60\u624b\u52a8\u6307\u5b9a\u4e86\u6240\u6709\u7684\u6570\u636e\u7c7b\u578b\u4e00\u6837\u3002<\/p>\n<p>\u5728\u8fd9\u4e2a\u4f8b\u5b50\u4e2d\uff0cvar\u5173\u952e\u5b57\u80fd\u591f\u5de5\u4f5c\u662f\u56e0\u4e3a\u53d8\u91cf\u662f\u5c40\u90e8\u7684\uff0c\u5e76\u4e14var\u6570\u636e\u7c7b\u578b\u4ec5\u9002\u7528\u4e8e\u5c40\u90e8\u53d8\u91cf\u3002\u5c40\u90e8\u53d8\u91cf\u662f\u5728\u65b9\u6cd5\u5185\u5b9a\u4e49\u7684\uff0c\u53ea\u80fd\u5728\u65b9\u6cd5\u5185\u90e8\u8bbf\u95ee\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5b83\u4eec\u88ab\u79f0\u4e3a&#8221;\u5c40\u90e8&#8221;\u7684\u539f\u56e0\u3002<\/p>\n<p>\u4e3a\u4e86\u5c55\u793avar\u53ea\u80fd\u7528\u4e8e\u5c40\u90e8\u53d8\u91cf\uff0c\u8bd5\u7740\u5c06\u5176\u653e\u5728main\u65b9\u6cd5\u5916\u9762\uff0c\u50cf\u8fd9\u6837\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\">public class Hello <span class=\"token punctuation\">{<\/span><\/li>\n<li data-prefix=\"jshell&gt;\"><mark>var hello <span class=\"token operator\">=<\/span> <span class=\"token string\">&#8220;Hello&#8221;<\/span><span class=\"token punctuation\">;<\/span><\/mark><\/li>\n<li data-prefix=\"jshell&gt;\">public static void main<span class=\"token punctuation\">(<\/span>String<span class=\"token punctuation\">[<\/span><span class=\"token punctuation\">]<\/span> args<span class=\"token punctuation\">)<\/span> <span class=\"token punctuation\">{<\/span><\/li>\n<li data-prefix=\"jshell&gt;\">\/\/ \u793a\u4f8b\u4ee3\u7801<\/li>\n<li data-prefix=\"jshell&gt;\"><span class=\"token punctuation\">}<\/span><\/li>\n<li data-prefix=\"jshell&gt;\"><span class=\"token punctuation\">}<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5f53\u4f60\u5c06\u4e0a\u8ff0\u4ee3\u7801\u7c98\u8d34\u5230jshell\u4e2d\u65f6\uff0c\u4f60\u4f1a\u5f97\u5230\u4ee5\u4e0b\u9519\u8bef\u4fe1\u606f\uff1a<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>| \u9519\u8bef\uff1a | \u6b64\u5904\u4e0d\u5141\u8bb8\u4f7f\u7528&#8217;var&#8217; | var hello = &#8220;Hello&#8221;; | ^-^<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u7531\u4e8ehello\u5728\u65b9\u6cd5\u4e4b\u5916\uff0c\u4e0d\u518d\u88ab\u89c6\u4e3a\u5c40\u90e8\u53d8\u91cf\uff0c\u6240\u4ee5\u4e0d\u5141\u8bb8\u4f7f\u7528var\u3002\u56e0\u6b64\uff0c\u975e\u5c40\u90e8\u53d8\u91cf\u4e0d\u9002\u7528\u4e8e\u7c7b\u578b\u63a8\u65ad\uff0c\u56e0\u4e3a\u4e0a\u4e0b\u6587\u65e0\u6cd5\u53ef\u9760\u5730\u7528\u4e8e\u68c0\u6d4b\u6570\u636e\u7c7b\u578b\u3002<\/p>\n<p>\u867d\u7136\u4f7f\u7528var\u53ef\u80fd\u5177\u6709\u6311\u6218\u6027\u4e14\u4e0d\u662f\u5fc5\u987b\u7684\uff0c\u4f46\u4f60\u5f88\u53ef\u80fd\u4f1a\u9047\u5230\u5b83\uff0c\u6240\u4ee5\u4e86\u89e3\u5b83\u5f88\u6709\u7528\u3002<\/p>\n<h2>\u4fdd\u7559\u5173\u952e\u8bcd<\/h2>\n<p>\u5728Java\u4e2d\u58f0\u660e\u53d8\u91cf\u65f6\uff0c\u8fd8\u6709\u4e00\u4e2a\u91cd\u8981\u7684\u89c4\u5219\u9700\u8981\u77e5\u9053\u3002\u6709\u4e00\u4e9b\u4fdd\u7559\u5173\u952e\u5b57\u662f\u4f60\u4e0d\u80fd\u7528\u4e8e\u53d8\u91cf\u540d\u7684\u3002\u4f8b\u5982\uff0c\u4f60\u4e0d\u80fd\u50cf\u8fd9\u6837\u58f0\u660e\u7c7b\u578b\u4e3aint\u7684\u539f\u59cb\u6570\u636e\u7c7b\u578b\u5e76\u5c06\u5176\u547d\u540d\u4e3anew\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<ol>\n<li data-prefix=\"jshell&gt;\">int <mark>new<\/mark> <span class=\"token operator\">=<\/span> <span class=\"token number\">1<\/span><span class=\"token punctuation\">;<\/span><\/li>\n<\/ol>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<p>\u5982\u679c\u4f60\u5c1d\u8bd5\u8fd9\u4e2a\u4f8b\u5b50\uff0c\u4f60\u4f1a\u56e0\u4e3anew\u662f\u4e00\u4e2a\u4fdd\u7559\u5173\u952e\u5b57\u800c\u5f97\u5230\u7f16\u8bd1\u9519\u8bef\u3002<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<div class=\"secondary-code-label\" title=\"Output\">\u8f93\u51fa<\/p>\n<pre class=\"post-pre\"><code><\/code><\/pre>\n<h2>Java\u4e2d\u7684\u4fdd\u7559\u5173\u952e\u5b57\u9519\u8bef<\/h2>\n<pre class=\"post-pre\"><code>| \u9519\u8bef\uff1a| \u9700\u8981 '.class' | int new = 1; | ^ | \u9519\u8bef\uff1a| \u9700\u8981 &lt;\u6807\u8bc6\u7b26&gt; | int new = 1; | ^ | \u9519\u8bef\uff1a| \u9700\u8981 '(' \u6216 '[' | int new = 1; | ^ | \u9519\u8bef\uff1a| \u610f\u5916\u7684\u7c7b\u578b | \u9700\u8981\uff1a\u503c | \u627e\u5230\uff1a\u7c7b | int new = 1; | ^--^ | \u9519\u8bef\uff1a| \u7f3a\u5c11\u8fd4\u56de\u8bed\u53e5 | int new = 1; | ^----------^<\/code><\/pre>\n<p>\u5173\u952e\u5b57<code>new<\/code>\u7528\u4e8e\u521b\u5efa\u65b0\u5bf9\u8c61\uff0c\u800cJava\u4e0d\u5e0c\u671b\u5b83\u51fa\u73b0\u5728\u8fd9\u4e2a\u4f4d\u7f6e\u3002\u5728\u5148\u524d\u8f93\u51fa\u7684\u9519\u8bef\u5217\u8868\u4e2d\uff0c\u7b2c\u4e00\u90e8\u5206\u662f\u6700\u91cd\u8981\u7684\u3002<\/p>\n<div class=\"secondary-code-label\" title=\"\u8f93\u51fa\">\n<pre class=\"post-pre\"><code>| \u9519\u8bef\uff1a| \u9700\u8981 '.class' | int new = 1; | ^<\/code><\/pre>\n<\/div>\n<p>\u9519\u8bef&#8221;.class&#8221;\u8868\u793a\uff0c\u5f53\u4f60\u4f7f\u7528<code>new<\/code>\u5173\u952e\u5b57\u65f6\uff0cJava\u671f\u671b\u540e\u9762\u63a5\u4e00\u4e2a\u7c7b\u3002\u5728\u8fd9\u4e00\u70b9\u4e0a\uff0cJava\u65e0\u6cd5\u89e3\u91ca\u8be5\u8bed\u53e5\uff0c\u968f\u540e\u51fa\u73b0\u4e86\u5176\u4ed6\u9519\u8bef\u3002<\/p>\n<p>\u5176\u4f59\u7684\u4fdd\u7559\u5173\u952e\u5b57\uff0c\u5982<code>abstract<\/code>\u3001<code>continue<\/code>\u3001<code>default<\/code>\u3001<code>for<\/code>\u548c<code>break<\/code>\uff0c\u5728Java\u4e2d\u4e5f\u6709\u7279\u5b9a\u7684\u610f\u4e49\uff0c\u4e0d\u80fd\u7528\u4f5c\u53d8\u91cf\u540d\u3002\u5b8c\u6574\u7684\u4fdd\u7559\u5173\u952e\u5b57\u5217\u8868\u53ef\u4ee5\u5728Java\u8bed\u8a00\u5173\u952e\u5b57\u9875\u9762\u627e\u5230\u3002\u5373\u4f7f\u60a8\u4e0d\u8bb0\u5f97\u6240\u6709\u4fdd\u7559\u5173\u952e\u5b57\uff0c\u60a8\u53ef\u4ee5\u901a\u8fc7\u7f16\u8bd1\u9519\u8bef\u6765\u8bc6\u522b\u95ee\u9898\u3002<\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>\u5728\u672c\u6559\u7a0b\u4e2d\uff0c\u60a8\u5b66\u4e60\u4e86Java\u4e2d\u7684\u57fa\u672c\u6570\u636e\u7c7b\u578b\u548c\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff0c\u8fd9\u662f\u4e00\u4e2a\u590d\u6742\u4f46\u5fc5\u8981\u7684\u8bdd\u9898\u3002\u82b1\u70b9\u65f6\u95f4\u7ec3\u4e60\u5e76\u591a\u6b21\u67e5\u770b\u793a\u4f8b\u3002\u5c1d\u8bd5\u66f4\u6539\u4e00\u4e9b\u6570\u636e\u7c7b\u578b\u548c\u6570\u503c\u3002\u6ce8\u610f\u9519\u8bef\u4f55\u65f6\u88ab\u629b\u51fa\u4ee5\u53ca\u4f55\u65f6\u4e0d\u88ab\u629b\u51fa\uff0c\u4ee5\u57f9\u517b\u5bf9\u6210\u529f\u4ee3\u7801\u6267\u884c\u7684\u611f\u77e5\u3002<\/p>\n<p>\u8981\u4e86\u89e3\u66f4\u591a\u5173\u4e8eJava\u7684\u5185\u5bb9\uff0c\u8bf7\u67e5\u770b\u6211\u4eec\u7684\u300aJava\u7f16\u7801\u7cfb\u5217\u6559\u7a0b\u300b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4f5c\u4e3a\u201c\u5199\u4f5c\u6362\u6350\u201d\u8ba1\u5212\u7684\u4e00\u90e8\u5206\uff0c\u4f5c\u8005\u9009\u62e9\u4e86\u81ea\u7531\u5f00\u6e90\u57fa\u91d1\u4f1a\u4f5c\u4e3a\u53d7\u8d60\u65b9\u3002 \u4ecb\u7ecdJava\u662f\u4e00\u79cd\u9759\u6001\u7c7b\u578b\u7684\u7f16\u7a0b\u8bed\u8a00\u3002\u8fd9\u610f [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[183,1200,180],"class_list":["post-386","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u672c\u6587\u5168\u9762\u4ecb\u7ecdJava\u4e2d\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5305\u62ec\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double\u3001char\u7b49\uff09\u548c\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff08\u7c7b\u3001\u6570\u7ec4\u3001\u63a5\u53e3\u7b49\uff09\u3002\u8be6\u7ec6\u89e3\u6790\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u7279\u70b9\u3001\u4f7f\u7528\u573a\u666f\u3001\u5185\u5b58\u5206\u914d\u4ee5\u53ca\u7c7b\u578b\u8f6c\u6362\u89c4\u5219\uff0c\u5e2e\u52a9Java\u521d\u5b66\u8005\u548c\u5f00\u53d1\u8005\u6df1\u5165\u7406\u89e3Java\u6570\u636e\u7c7b\u578b\u4f53\u7cfb\uff0c\u4e3a\u7f16\u5199\u9ad8\u6548Java\u4ee3\u7801\u5960\u5b9a\u57fa\u7840\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u7406\u89e3java\u4e2d\u7684\u6570\u636e\u7c7b\u578b\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u5168\u9762\u4ecb\u7ecdJava\u4e2d\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5305\u62ec\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double\u3001char\u7b49\uff09\u548c\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff08\u7c7b\u3001\u6570\u7ec4\u3001\u63a5\u53e3\u7b49\uff09\u3002\u8be6\u7ec6\u89e3\u6790\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u7279\u70b9\u3001\u4f7f\u7528\u573a\u666f\u3001\u5185\u5b58\u5206\u914d\u4ee5\u53ca\u7c7b\u578b\u8f6c\u6362\u89c4\u5219\uff0c\u5e2e\u52a9Java\u521d\u5b66\u8005\u548c\u5f00\u53d1\u8005\u6df1\u5165\u7406\u89e3Java\u6570\u636e\u7c7b\u578b\u4f53\u7cfb\uff0c\u4e3a\u7f16\u5199\u9ad8\u6548Java\u4ee3\u7801\u5960\u5b9a\u57fa\u7840\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u7406\u89e3java\u4e2d\u7684\u6570\u636e\u7c7b\u578b\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-28T10:38:16+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-01T19:32:45+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/\",\"name\":\"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-03-28T10:38:16+00:00\",\"dateModified\":\"2025-08-01T19:32:45+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"description\":\"\u672c\u6587\u5168\u9762\u4ecb\u7ecdJava\u4e2d\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5305\u62ec\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double\u3001char\u7b49\uff09\u548c\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff08\u7c7b\u3001\u6570\u7ec4\u3001\u63a5\u53e3\u7b49\uff09\u3002\u8be6\u7ec6\u89e3\u6790\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u7279\u70b9\u3001\u4f7f\u7528\u573a\u666f\u3001\u5185\u5b58\u5206\u914d\u4ee5\u53ca\u7c7b\u578b\u8f6c\u6362\u89c4\u5219\uff0c\u5e2e\u52a9Java\u521d\u5b66\u8005\u548c\u5f00\u53d1\u8005\u6df1\u5165\u7406\u89e3Java\u6570\u636e\u7c7b\u578b\u4f53\u7cfb\uff0c\u4e3a\u7f16\u5199\u9ad8\u6548Java\u4ee3\u7801\u5960\u5b9a\u57fa\u7840\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3 - Blog - Silicon Cloud","description":"\u672c\u6587\u5168\u9762\u4ecb\u7ecdJava\u4e2d\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5305\u62ec\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double\u3001char\u7b49\uff09\u548c\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff08\u7c7b\u3001\u6570\u7ec4\u3001\u63a5\u53e3\u7b49\uff09\u3002\u8be6\u7ec6\u89e3\u6790\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u7279\u70b9\u3001\u4f7f\u7528\u573a\u666f\u3001\u5185\u5b58\u5206\u914d\u4ee5\u53ca\u7c7b\u578b\u8f6c\u6362\u89c4\u5219\uff0c\u5e2e\u52a9Java\u521d\u5b66\u8005\u548c\u5f00\u53d1\u8005\u6df1\u5165\u7406\u89e3Java\u6570\u636e\u7c7b\u578b\u4f53\u7cfb\uff0c\u4e3a\u7f16\u5199\u9ad8\u6548Java\u4ee3\u7801\u5960\u5b9a\u57fa\u7840\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u7406\u89e3java\u4e2d\u7684\u6570\u636e\u7c7b\u578b\/","og_locale":"zh_CN","og_type":"article","og_title":"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3","og_description":"\u672c\u6587\u5168\u9762\u4ecb\u7ecdJava\u4e2d\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5305\u62ec\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double\u3001char\u7b49\uff09\u548c\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff08\u7c7b\u3001\u6570\u7ec4\u3001\u63a5\u53e3\u7b49\uff09\u3002\u8be6\u7ec6\u89e3\u6790\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u7279\u70b9\u3001\u4f7f\u7528\u573a\u666f\u3001\u5185\u5b58\u5206\u914d\u4ee5\u53ca\u7c7b\u578b\u8f6c\u6362\u89c4\u5219\uff0c\u5e2e\u52a9Java\u521d\u5b66\u8005\u548c\u5f00\u53d1\u8005\u6df1\u5165\u7406\u89e3Java\u6570\u636e\u7c7b\u578b\u4f53\u7cfb\uff0c\u4e3a\u7f16\u5199\u9ad8\u6548Java\u4ee3\u7801\u5960\u5b9a\u57fa\u7840\u3002","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u7406\u89e3java\u4e2d\u7684\u6570\u636e\u7c7b\u578b\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-03-28T10:38:16+00:00","article_modified_time":"2025-08-01T19:32:45+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/","name":"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-03-28T10:38:16+00:00","dateModified":"2025-08-01T19:32:45+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"description":"\u672c\u6587\u5168\u9762\u4ecb\u7ecdJava\u4e2d\u7684\u6570\u636e\u7c7b\u578b\uff0c\u5305\u62ec\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff08int\u3001double\u3001char\u7b49\uff09\u548c\u5f15\u7528\u6570\u636e\u7c7b\u578b\uff08\u7c7b\u3001\u6570\u7ec4\u3001\u63a5\u53e3\u7b49\uff09\u3002\u8be6\u7ec6\u89e3\u6790\u5404\u79cd\u6570\u636e\u7c7b\u578b\u7684\u7279\u70b9\u3001\u4f7f\u7528\u573a\u666f\u3001\u5185\u5b58\u5206\u914d\u4ee5\u53ca\u7c7b\u578b\u8f6c\u6362\u89c4\u5219\uff0c\u5e2e\u52a9Java\u521d\u5b66\u8005\u548c\u5f00\u53d1\u8005\u6df1\u5165\u7406\u89e3Java\u6570\u636e\u7c7b\u578b\u4f53\u7cfb\uff0c\u4e3a\u7f16\u5199\u9ad8\u6548Java\u4ee3\u7801\u5960\u5b9a\u57fa\u7840\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"Java\u6570\u636e\u7c7b\u578b\u5b8c\u5168\u6307\u5357\uff1a\u57fa\u672c\u7c7b\u578b\u4e0e\u5f15\u7528\u7c7b\u578b\u8be6\u89e3"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%90%86%e8%a7%a3java%e4%b8%ad%e7%9a%84%e6%95%b0%e6%8d%ae%e7%b1%bb%e5%9e%8b\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=386"}],"version-history":[{"count":4,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/386\/revisions"}],"predecessor-version":[{"id":109948,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/386\/revisions\/109948"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}