{"id":219,"date":"2020-01-30T11:30:02","date_gmt":"2020-01-30T03:30:02","guid":{"rendered":"http:\/\/ff.mhrooz.xyz\/?p=219"},"modified":"2020-03-13T17:37:46","modified_gmt":"2020-03-13T09:37:46","slug":"java_ri_chang_xue_xi","status":"publish","type":"post","link":"https:\/\/blog.mhrooz.xyz\/index.php\/2020\/01\/30\/java_ri_chang_xue_xi\/","title":{"rendered":"java\u65e5\u5e38\u5b66\u4e60"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote\"><p>PS:xp\u4e0a\u7684\u706b\u72d0\u771f\u597d\u7528\u3002\u3002\u3002360\u6781\u901f\u6d4f\u89c8\u5668\u7684chrome\u5728xp\u4e0a\u5c45\u7136\u652f\u6301\u523069\uff0c\u6211\u592a\u9ad8\u5174\u4e86\u3002\u3002\u3002\u914d\u5408\u4e0axshell5\u94fe\u63a5\u670d\u52a1\u5668\uff0c\u518d\u52a0\u4e0a\u5b66\u751f\u673a\u4e0a\u90e8\u7f72\u7684code-server\uff0c\u68a6\u56de2010\u5931\u8d25\u3002^^<\/p><\/blockquote>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"1024\" height=\"640\" src=\"http:\/\/iizz.ddns.net:9595\/wp-content\/uploads\/2020\/01\/\u56fe\u7247-1024x640.png\" alt=\"\" class=\"wp-image-220\" srcset=\"https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/01\/\u56fe\u7247-1024x640.png 1024w, https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/01\/\u56fe\u7247-300x188.png 300w, https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/01\/\u56fe\u7247-768x480.png 768w, https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/01\/\u56fe\u7247.png 1440w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><figcaption>\u7a9d\u5728\u5bb6\u91cc\u7684\u65e5\u5e38<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Java\u8bbf\u95ee\u63a7\u5236\u7b26\u7684\u542b\u4e49\u548c\u4f7f\u7528\u60c5\u51b5<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><tbody><tr><td><\/td><td>\u672c\u7c7b<\/td><td>\u672c\u5305<\/td><td>\u5b50\u7c7b<\/td><td>\u5916\u90e8\u5305<\/td><\/tr><tr><td>public<\/td><td> \u221a <\/td><td> \u221a <\/td><td> \u221a <\/td><td> \u221a <\/td><\/tr><tr><td>protected<\/td><td> \u221a <\/td><td> \u221a <\/td><td> \u221a <\/td><td> X <\/td><\/tr><tr><td>default<\/td><td> \u221a <\/td><td> \u221a <\/td><td> X <\/td><td> X <\/td><\/tr><tr><td>private<\/td><td> \u221a <\/td><td> X <\/td><td> X <\/td><td> X <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator is-style-wide\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\u65b9\u6cd5\u548c\u65b9\u6cd5\u4e4b\u95f4\u7684\u8c03\u7528<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\"> \u9759\u6001\u65b9\u6cd5 <\/h4>\n\n\n\n<p>\u672c\u7c7b\u4e2d\uff1a     \u9759\u6001\u65b9\u6cd5\uff1a\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528<br>                   \u975e\u9759\u6001\u65b9\u6cd5\uff1a\u4e0d\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\uff0c\u8981\u901a\u8fc7\u521b\u5efa\u5bf9\u8c61\u8c03\u7528<br>\u4e0d\u540c\u7c7b\u4e2d\uff1a  \u9759\u6001\u65b9\u6cd5\uff1a\u5bfc\u5165\u5305\uff0c\u7c7b\u540d.\u9759\u6001\u65b9\u6cd5()<br>                    \u975e\u9759\u6001\u65b9\u6cd5\uff1a\u5bfc\u5165\u5305\uff0c\u521b\u5efa\u5bf9\u8c61\uff0c\u8c03\u7528<\/p>\n\n\n\n<hr class=\"wp-block-separator is-style-dots\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">\u975e\u9759\u6001\u65b9\u6cd5<\/h4>\n\n\n\n<p>\u672c\u7c7b\u4e2d\uff1a      \u9759\u6001\u65b9\u6cd5\uff1a\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528<br>                    \u975e\u9759\u6001\u65b9\u6cd5\uff1a\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528<br>\u4e0d\u540c\u7c7b\u4e2d\uff1a    \u9759\u6001\u65b9\u6cd5\uff1a\u5bfc\u5165\u5305\uff0c\u7c7b\u540d.\u9759\u6001\u65b9\u6cd5()<br>                    \u975e\u9759\u6001\u65b9\u6cd5\uff1a\u5bfc\u5165\u5305\uff0c\u521b\u5efa\u5bf9\u8c61\uff0c\u5bf9\u8c61\u540d.\u975e\u9759\u6001\u65b9\u6cd5()<\/p>\n\n\n\n<p>\u5199\u5230\u8fd9\u91cc\u5176\u5b9e\u611f\u89c9\uff0c\u9759\u6001\u65b9\u6cd5\u5c31\u662fJava\u7c7b\u7684\u4e00\u4e2a\u5c5e\u6027\uff0c\u662f\u76f4\u63a5\u5c5e\u4e8e\u7c7b\u91cc\u9762\u7684\uff0c\u6240\u4ee5\u5728\u9759\u6001\u975e\u9759\u6001\u65b9\u6cd5\u91cc\u90fd\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528\uff0c\u975e\u9759\u6001\u65b9\u6cd5\u662f\u4e00\u4e2a\u989d\u5916\u7684\uff0c\u9644\u5c5e\u4e8e\u5bf9\u8c61\u7684\uff0c\u6240\u4ee5\u8981\u901a\u8fc7\u65b0\u5efa\u5bf9\u8c61\u6765\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>Example\uff1a<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">public class test{\n    private int x = 0;\n    public static int y = 6;\/\/\u9759\u6001\u65b9\u6cd5\u8c03\u7528\u7684\u65f6\u5019\u53ea\u80fd\u8c03\u7528\u9759\u6001\u53d8\u91cf\n    public static void main(String[] args){\n        test T = new test();\/\/\u8c03\u7528\u81ea\u5df1\u7684\u7c7b\n        testPrint();\/\/\u76f4\u63a5\u672c\u7c7b\u7684\u8c03\u7528\u9759\u6001\u65b9\u6cd5\n        test.testPrint();\/\/\u7c7b\u540d\u8c03\u7528\u9759\u6001\u65b9\u6cd5\n        test doge = new test();\/\/\u4e24\u4e2a\u6784\u9020\u5668\n        test cate = new test(10);        \n        System.out.println(T.f(\"Mhrooz\"));\n        B b = new B();\/\/\u8c03\u7528\u5176\u4ed6\u7684\u7c7b\n        B.PrintDefault();\/\/\u8c03\u7528\u9759\u6001\u51fd\u6570\n        b.printValue();\n        b.setValue(5);\n        b.printValue();\n    }\n    public test(int x)\/\/\u8c03\u7528\u6784\u9020\u5668 at 7 line.\n    {\n        this.x = x;\n        System.out.println(\"Test here is \"+this.x);\n    }\n    public test()\/\/\u8c03\u7528\u6784\u9020\u5668 at 6 line.\n    {\n        this(1); \/\/this must at the first line.\n        \/*\n            this(2); \/\/If it is at second line,this is also wrong.\n        *\/\n        System.out.println(\"Get it\");        \n        System.out.println(\"Test here is \"+this.x);\n    }\n    public static void testPrint()\n    {\n        System.out.println(y+5);\/\/\u8c03\u7528\u9759\u6001\u53d8\u91cf\n    }\n    public long f(int x){\/\/\u9012\u5f52\u8c03\u7528\u5b9e\u73b0\u9636\u4e58\n        if(x == 1)  return 1;\n        return x * f( x - 1 );\n    }\n    public long f(String s)\n    {\n        return (long)s.charAt(0);\n    }\n}\n\nclass B{\n    private int value = 0;\n    private static int defaultValue = 6;\n    public static void PrintDefault()\n    {\n        System.out.println(defaultValue);\n    }\n    public void setValue(int x){\n        value = x;\n    }\n\n    public void printValue(){\n        System.out.println(value);\n    }\n\n}\n<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u5bfc\u5165\u5bfc\u51fa\u5305&amp;\u547d\u4ee4\u884c\u7f16\u8bd1\u8fd0\u884c<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1.\u5bfc\u5165\u5305\u4e2d\u7684\u6240\u6709\u7c7b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import name.*<\/pre>\n\n\n\n<p>name\u8868\u793a\u5305\u7684\u540d\u5b57<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">2.\u5bfc\u5165\u5305\u4e2d\u7684\u90e8\u5206\u7c7b<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">import name.class<\/pre>\n\n\n\n<p>name\u8868\u793a\u5305\u7684\u540d\u5b57\uff0cclass\u8868\u793a\u7c7b\u7684\u540d\u5b57<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">3.\u7f16\u8bd1\u5305<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">javac -d . name.java<\/pre>\n\n\n\n<p>-d\u8868\u793a\u521b\u5efa\u76ee\u5f55\uff0c.\u8868\u793a\u5f53\u524d\u6587\u4ef6\u5939\uff0c\u540e\u9762\u662f\u6587\u4ef6\u540d\uff0c\u6ce8\u610f\u4e2d\u95f4\u6709\u7a7a\u683c<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">4.\u8fd0\u884c\u5305<\/h4>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">java packagepath\/class<\/pre>\n\n\n\n<p>packagepath\u8868\u793a\u5305\u8def\u5f84\uff0c\u6700\u540e\u52a0\u4e0a\u542b\u6709main\u7684\u7c7b<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"429\" height=\"70\" src=\"http:\/\/iizz.ddns.net:9595\/wp-content\/uploads\/2020\/01\/image.png\" alt=\"\" class=\"wp-image-229\" srcset=\"https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/01\/image.png 429w, https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/01\/image-300x49.png 300w\" sizes=\"(max-width: 429px) 100vw, 429px\" \/><figcaption>\u6253\u5305\u8fd0\u884c\u6307\u4ee4\uff0c\u7b2c\u4e00\u4e2a\u662f\u7f16\u8bd1\uff0c\u7b2c\u4e8c\u4e2a\u662f\u8fd0\u884c<\/figcaption><\/figure>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"enlighter\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/\u4e0a\u8ff0\u7684\u7f16\u8bd1\u6e90\u4ee3\u7801\npackage xyz.mhrooz;\npublic class Package{\n    public static void main(String[] args){\n        System.out.println(\"Test package\");\n        test.cal(5);\n    }\n}\n\nclass test{\n    private static int x = 5;\n    public static int cal(int y){\/\/ calculate y + 5\n        System.out.println(\"Your number is \"+y);\n        return x + y;\n    }\n}<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u52a8\u6001\u94fe\u63a5<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">\u5411\u4e0a\u8f6c\u578b<\/h4>\n\n\n\n<p>\u7236\u7c7b\u7684\u5f15\u7528\u6307\u5411\u5b50\u7c7b\u3002<\/p>\n\n\n\n<p>\u52a8\u6001\u94fe\u63a5\u662fJava\u7684\u4e00\u79cd\u7279\u6027\uff0c\u5177\u4f53\u5b9e\u73b0\u5c31\u662f\uff0c\u7236\u7c7b\u7684\u5f15\u7528\u6307\u5411\u5b50\u7c7b\u540e\uff0c\u4e0d\u80fd\u4f7f\u7528\u5b50\u7c7b\u81ea\u6709\u7684\u65b9\u6cd5\uff0c\u800c\u53ef\u4ee5\u4f7f\u7528\u5b50\u7c7b\u91cd\u8f7d\u7236\u7c7b\u7684\u65b9\u6cd5\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">package com.father;\npublic class father{\n    public void say(){\n        System.out.println(\"Father say: Wow !\");\n    }\n    public static void main(String[] args){\n        System.out.println(\"Who says?\");\n        father F = new son();\/\/\u5411\u4e0a\u8f6c\u578b\n        F.say();\/\/\u8f93\u51faSon say\n    }\n\n}\n\nclass son extends father{\n    public void say(){\n        System.out.println(\"Son say: NO!~\");\n    }\n}<\/pre>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\u8f93\u51fa\nWho says?\nSon say: NO!~<\/pre>\n\n\n\n<p>\u5982\u679c\u7236\u7c7b\u65b9\u6cd5\u662f\u9759\u6001\u7684\uff0c\u90a3\u4e48\u6267\u884c\u7684\u8fd8\u662f\u7236\u7c7b\u7684\u65b9\u6cd5\uff0c\u8fd9\u4e2a\u53eb\u505a<strong>\u9759\u6001\u7ed1\u5b9a<\/strong><\/p>\n\n\n\n<h1 class=\"wp-block-heading\">\u5bf9\u8c61\u7fa4\u4f53\u7684\u7ec4\u7ec7<\/h1>\n\n\n\n<h2 class=\"wp-block-heading\">7.1 \u5bf9\u8c61\u6570\u7ec4<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u6570\u7ec4<\/h3>\n\n\n\n<p>\u00b7 \u6548\u7387\u6700\u9ad8\u7684\u968f\u673a\u8bbf\u95ee\u5e8f\u5217<\/p>\n\n\n\n<p>\u00b7 \u7c7b\u578b\u68c0\u67e5<\/p>\n\n\n\n<p>\u00b7 \u8fb9\u754c\u68c0\u67e5<\/p>\n\n\n\n<p>\u00b7 \u52a8\u6001\u6027\u5dee<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u96c6\u5408<\/h2>\n\n\n\n<p>\u00b7 \u53ef\u52a8\u6001\u6539\u53d8\u5927\u5c0f<\/p>\n\n\n\n<p>\u00b7 \u53ef\u4ee5\u5728\u5e8f\u5217\u4e2d\u50a8\u5b58\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u636e<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u96c6\u5408<\/h3>\n\n\n\n<p>\u628a\u5177\u6709\u76f8\u540c\u6027\u8d28\u7684\u4e00\u7c7b\u4e1c\u897f\uff0c\u6c47\u805a\u6210\u4e00\u4e2a\u6574\u4f53<\/p>\n\n\n\n<p>\u5728Java2\u4e2d\u6709\u5f88\u591a\u4e0e\u96c6\u5408\u76f8\u5173\u7684\u63a5\u53e3\u53ca\u7c7b<\/p>\n\n\n\n<p>\u25b2\u4e0d\u80fd\u5b58\u653e\u57fa\u672c\u6570\u636e\u7c7b\u578b\uff0c\u53ea\u80fd\u5b58\u653e<strong>\u5bf9\u8c61<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u96c6\u5408\u6846\u67b6(JAVA COLLECTIONS FRAMEWORK)<\/h3>\n\n\n\n<p>\u4e3a\u8868\u793a\u548c\u64cd\u4f5c\u96c6\u5408\u800c\u89c4\u5b9a\u7684\u4e00\u79cd\u7edf\u4e00\u7684\u6807\u51c6\u7684\u4f53\u7cfb\u7ed3\u6784<\/p>\n\n\n\n<p>\u63d0\u4f9b\u4e86\u4e00\u4e9b\u73b0\u6210\u7684\u6570\u636e\u7ed3\u6784\u53ef\u4f9b\u4f7f\u7528\uff0c\u7a0b\u5e8f\u5458\u53ef\u4ee5\u5229\u7528\u96c6\u5408\u6846\u67b6\u5feb\u901f\u7f16\u5199\u4ee3\u7801\uff0c\u5e76\u83b7\u5f97\u4f18\u826f\u6027\u80fd<\/p>\n\n\n\n<p>\u5305\u542b\u4e09\u5927\u5757\u5185\u5bb9<\/p>\n\n\n\n<p>\u00d8\u5bf9\u5916\u7684\u63a5\u53e3\uff1a\u8868\u793a\u96c6\u5408\u7684\u62bd\u8c61\u6570\u636e\u7c7b\u578b\uff0c\u4f7f\u96c6\u5408\u7684\u64cd\u4f5c\u4e0e\u8868\u793a\u5206\u5f00<\/p>\n\n\n\n<p>\u00d8\u63a5\u53e3\u7684\u5b9e\u73b0\uff1a\u6307\u5b9e\u73b0\u96c6\u5408\u63a5\u53e3\u7684Java\u7c7b\uff0c\u662f\u53ef\u91cd\u7528\u7684\u6570\u636e\u7ed3\u6784<\/p>\n\n\n\n<p>\u00d8\u5bf9\u96c6\u5408\u8fd0\u7b97\u7684\u7b97\u6cd5\uff1a\u662f\u6307\u6267\u884c\u8fd0\u7b97\u7684\u65b9\u6cd5\uff0c\u4f8b\u5982\u5728\u96c6\u5408\u4e0a\u8fdb\u884c\u67e5\u627e\u548c\u6392\u5e8f<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u96c6\u5408\u6846\u67b6\u63a5\u53e3<\/h3>\n\n\n\n<p>\u58f0\u660e\u4e86\u5bf9\u5404\u79cd\u96c6\u5408\u7c7b\u578b\u6267\u884c\u7684\u4e00\u822c\u64cd\u4f5c<\/p>\n\n\n\n<p>\u5305\u62ecCollection\u3001Set\u3001List\u3001SortedSet\u3001Map\u3001SortedMap<\/p>\n\n\n\n<p>Java\u96c6\u5408\u4e3b\u8981\u5305\u62ec\u4e09\u79cd\u7c7b\u578b\uff1aSet(\u96c6)\uff0cList(\u5217\u8868)\uff0cMap(\u6620\u5c04)\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" loading=\"lazy\" width=\"522\" height=\"323\" src=\"http:\/\/iizz.ddns.net:9595\/wp-content\/uploads\/2020\/03\/image-20200313162704908.png\" alt=\"image-20200313162704908\" class=\"wp-image-292\" srcset=\"https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/03\/image-20200313162704908.png 522w, https:\/\/blog.mhrooz.xyz\/wp-content\/uploads\/2020\/03\/image-20200313162704908-300x186.png 300w\" sizes=\"(max-width: 522px) 100vw, 522px\" \/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">COLLECTION\u63a5\u53e3<\/h3>\n\n\n\n<p>\u58f0\u660e\u65f6\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e2a\u53c2\u6570\u7c7b\u578b\uff0c\u5373Collection&lt;E&gt; <\/p>\n\n\n\n<p>\u58f0\u660e\u4e86\u4e00\u7ec4\u64cd\u4f5c\u6210\u6279\u5bf9\u8c61\u7684\u62bd\u8c61\u65b9\u6cd5\uff1a\u67e5\u8be2\u65b9\u6cd5\u3001\u4fee\u6539\u65b9\u6cd5<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u67e5\u8be2\u65b9\u6cd5<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;int size() \u2013 \u8fd4\u56de\u96c6\u5408\u5bf9\u8c61\u4e2d\u5305\u542b\u7684\u5143\u7d20\u4e2a\u6570<br>&nbsp;\u200b<br>&nbsp;boolean isEmpty() \u2013 \u5224\u65ad\u96c6\u5408\u5bf9\u8c61\u4e2d\u662f\u5426\u8fd8\u5305\u542b\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u5143\u7d20\uff0c\u5219\u8fd4\u56detrue<br>&nbsp;\u200b<br>&nbsp;boolean contains(Object obj) \u2013 \u5224\u65ad\u5bf9\u8c61\u662f\u5426\u5728\u96c6\u5408\u4e2d<br>&nbsp;\u200b<br>&nbsp;boolean containsAll(Collection c) \u2013 \u5224\u65ad\u65b9\u6cd5\u7684\u63a5\u6536\u8005\u5bf9\u8c61\u662f\u5426\u5305\u542b\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5143\u7d20<\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u4fee\u6539\u65b9\u6cd5<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;boolean add(Object obj) \u2013 \u5411\u96c6\u5408\u4e2d\u589e\u52a0\u5bf9\u8c61<br>&nbsp;\u200b<br>&nbsp;boolean addAll(Collection&lt;?&gt; c) \u2013 \u5c06\u53c2\u6570\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5143\u7d20\u589e\u52a0\u5230\u63a5\u6536\u8005\u96c6\u5408\u4e2d<br>&nbsp;\u200b<br>&nbsp;boolean remove(Object obj) \u2013\u4ece\u96c6\u5408\u4e2d\u5220\u9664\u5bf9\u8c61<br>&nbsp;\u200b<br>&nbsp;boolean removeAll(Collection c) -\u5c06\u53c2\u6570\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5143\u7d20\u4ece\u63a5\u6536\u8005\u96c6\u5408\u4e2d\u5220\u9664<br>&nbsp;\u200b<br>&nbsp;boolean retainAll(Collection c) \u2013 \u5728\u63a5\u6536\u8005\u96c6\u5408\u4e2d\u4fdd\u7559\u53c2\u6570\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5143\u7d20\uff0c\u5176\u5b83\u5143\u7d20\u90fd\u5220\u9664<br>&nbsp;\u200b<br>&nbsp;void clear() \u2013 \u5220\u9664\u96c6\u5408\u4e2d\u7684\u6240\u6709\u5143\u7d20<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">SET\u63a5\u53e3<\/h3>\n\n\n\n<p>\u00d8\u6269\u5c55\u4e86Collection<\/p>\n\n\n\n<p>\u00d8\u7981\u6b62\u91cd\u590d\u7684\u5143\u7d20\uff0c\u662f\u6570\u5b66\u4e2d\u201c\u96c6\u5408\u201d\u7684\u62bd\u8c61<\/p>\n\n\n\n<p>\u00d8\u5bf9<code>equals<\/code>\u548c<code>hashCode<\/code>\u64cd\u4f5c\u6709\u4e86\u66f4\u5f3a\u7684\u7ea6\u5b9a\uff0c\u5982\u679c\u4e24\u4e2aSet\u5bf9\u8c61\u5305\u542b\u540c\u6837\u7684\u5143\u7d20\uff0c\u4e8c\u8005\u4fbf\u662f\u76f8\u7b49\u7684<\/p>\n\n\n\n<p>\u00d8\u5b9e\u73b0\u5b83\u7684\u4e24\u4e2a\u4e3b\u8981\u7c7b\u662f\u54c8\u5e0c\u96c6\u5408<code>(HashSet)<\/code>\u53ca\u6811\u96c6\u5408<code>(TreeSet)<\/code><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">SORTEDSET\u63a5\u53e3<\/h3>\n\n\n\n<p>\u00d8\u4e00\u79cd\u7279\u6b8a\u7684<code>Set<\/code><\/p>\n\n\n\n<p>\u00d8\u5176\u4e2d\u7684\u5143\u7d20\u662f\u5347\u5e8f\u6392\u5217\u7684\uff0c\u8fd8\u589e\u52a0\u4e86\u4e0e\u6b21\u5e8f\u76f8\u5173\u7684\u64cd\u4f5c<\/p>\n\n\n\n<p>\u00d8\u901a\u5e38\u7528\u4e8e\u5b58\u653e\u8bcd\u6c47\u8868\u8fd9\u6837\u7684\u5185\u5bb9<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>SET<\/strong>\u7684\u4e00\u822c\u7528\u6cd5<\/h3>\n\n\n\n<p><code>Set<\/code>\u96c6\u5408\u4e2d\u5b58\u653e\u7684\u662f\u5bf9\u8c61\uff0c\u5e76\u4e14\u6ca1\u6709\u91cd\u590d\u5bf9\u8c61\u3002<\/p>\n\n\n\n<p>Java\u4e2d\u5b9e\u73b0<code>Set<\/code>\u63a5\u53e3\u7684\u7c7b\u5f88\u591a\uff0c\u81f3\u4e8e\u8be5\u7528\u54ea\u4e2a\uff0c\u6211\u4eec\u4e0d\u7528\u533a\u5206\uff0c\u6211\u4eec\u53ea\u5bf9\u63a5\u53e3\u8d1f\u8d23\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;Set set = new HashSet();<\/pre>\n\n\n\n<p>\u8fd9\u6837\u5c31\u521b\u5efa\u4e86\u4e00\u4e2a\u96c6\u5408\u5bf9\u8c61\uff0c\u6211\u4eec\u628a\u5b83\u5f53\u4f5c\u62bd\u8c61\u7684\u96c6\u5408\u63a5\u53e3\u770b\u5f85\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528\u63a5\u53e3\u7684\u597d\u5904\u5728\u4e8e\uff0c\u5b9e\u73b0\u7c7b\u5c06\u6765\u53ef\u4ee5\u88ab\u66ff\u6362\uff0c\u800c\u7a0b\u5e8f\u4e0d\u7528\u505a\u5f88\u591a\u6539\u52a8\u3002<\/p>\n\n\n\n<p>\u4f8b\uff1aSet\u96c6\u5408\u4f9d\u6b21\u628a\u4e09\u4e2a\u5f15\u7528\u53d8\u91cf\u52a0\u5165\u5230\u96c6\u5408\u4e2d<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;Set&lt;String&gt; &nbsp;set=new HashSet&lt;String&gt;();<br>&nbsp;String &nbsp;s1=new &nbsp;String(\u201cHello\u201d);<br>&nbsp;String &nbsp;s2=new &nbsp;String(\u201cHello\u201d); <br>&nbsp;String &nbsp;s3=new &nbsp;String(\u201cWorld\u201d);<br>&nbsp;set.add(s1);<br>&nbsp;set.add(s2);<br>&nbsp;set.add(s3);<br>&nbsp;System.out.println(set.size()); &nbsp; \/\/\u5bf9\u8c61\u7684\u6570\u76ee\u4e3a2<\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;Set&lt;String&gt; &nbsp;emp=new HashSet&lt;String&gt;();<br>&nbsp;emp.add(\"Tom\");<br>&nbsp;emp.add(\"Mike\");<br>&nbsp;emp.add(\"Jack\");<br>&nbsp;emp.remove(\"Tom\");<br>&nbsp;emp.remove(\"Jack\");<br>&nbsp;emp.add(\"Linda\");<br>&nbsp;System.out.println(emp.size()); &nbsp; \/\/\u5bf9\u8c61\u7684\u6570\u76ee\u4e3a2<br>&nbsp;\u200b<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">HASHSET\u7c7b<\/h3>\n\n\n\n<p><code>HashSet<\/code>\u7c7b\u6309\u7167\u54c8\u5e0c\u7b97\u6cd5\u6765\u5b58\u53d6\u96c6\u5408\u4e2d\u7684\u5bf9\u8c61\uff0c\u5177\u6709\u5f88\u597d\u7684\u5b58\u53d6\u548c\u67e5\u627e\u6027\u80fd\u3002<\/p>\n\n\n\n<p>\u5f53\u5411\u96c6\u5408\u4e2d\u52a0\u5165\u4e00\u4e2a\u5bf9\u8c61\u65f6\uff0c<code>HashSet<\/code>\u4f1a\u8c03\u7528\u5bf9\u8c61\u7684<code>hashCode()<\/code>\u65b9\u6cd5\u6765\u83b7\u5f97\u54c8\u5e0c\u7801\uff0c\u7136\u540e\u6839\u636e\u54c8\u5e0c\u7801\u8fdb\u4e00\u6b65\u8ba1\u7b97\u51fa\u5bf9\u8c61\u5728\u96c6\u5408\u4e2d\u7684\u4f4d\u7f6e\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">ITERATOR\u7c7b<\/h3>\n\n\n\n<p><code>Iterable<\/code>\uff1a\u5b9e\u73b0\u8fd9\u4e2a\u63a5\u53e3\u7684\u96c6\u5408\u5bf9\u8c61\u652f\u6301\u8fed\u4ee3\uff0c\u662f\u53ef\u4ee5\u8fed\u4ee3\u7684\u3002\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u53ef\u4ee5\u914d\u5408<code>foreach<\/code>\u4f7f\u7528\u3002<\/p>\n\n\n\n<p>Iterator\uff1a\u8fed\u4ee3\u5668\uff0c\u63d0\u4f9b\u8fed\u4ee3\u673a\u5236\u7684\u5bf9\u8c61\uff0c\u5177\u4f53\u5982\u4f55\u8fed\u4ee3\u662f\u8fd9\u4e2aIterator\u63a5\u53e3\u89c4\u8303\u7684\u3002\u5305\u542b\u4e09\u4e2a\u65b9\u6cd5\uff1a<code>hasNext<\/code>\u3001<code>next<\/code>\u3001<code>remove<\/code>\uff0c<code>remove<\/code>\u4e00\u822c\u5f88\u5c11\u7528\u5230\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u96c6\u5408\u4e2d\u7684\u5143\u7d20\u6ca1\u6709\u6392\u5e8f\uff0cIterator\u904d\u5386\u96c6\u5408\u4e2d\u5143\u7d20\u7684\u987a\u5e8f\u662f\u4efb\u610f\u7684\uff0c\u5e76\u4e0d\u4e00\u5b9a\u4e0e\u96c6\u5408\u4e2d\u52a0\u5165\u5143\u7d20\u7684\u987a\u5e8f\u662f\u4e00\u81f4\u7684\u3002<\/p>\n\n\n\n<p>Iterator\u529f\u80fd\u6bd4\u8f83\u7b80\u5355\uff0c\u5e76\u4e14\u53ea\u80fd\u5355\u5411\u79fb\u52a8\uff1a<\/p>\n\n\n\n<p>1.\u4f7f\u7528\u65b9\u6cd5iterator()\u8981\u6c42\u5bb9\u5668\u8fd4\u56de\u4e00\u4e2a<code>Iterator<\/code>\u3002\u7b2c\u4e00\u6b21\u8c03\u7528<code>Iterator<\/code>\u7684<code>next()<\/code>\u65b9\u6cd5\u65f6\uff0c\u5b83\u8fd4\u56de\u5e8f\u5217\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20\u3002\u6ce8\u610f\uff1a<code>iterator()<\/code>\u65b9\u6cd5\u662f<code>java.lang.Iterable<\/code>\u63a5\u53e3,\u88abCollection\u7ee7\u627f\u3002<\/p>\n\n\n\n<p>2.\u4f7f\u7528<code>next()<\/code>\u83b7\u5f97\u5e8f\u5217\u4e2d\u7684\u4e0b\u4e00\u4e2a\u5143\u7d20\u3002<\/p>\n\n\n\n<p>3.\u4f7f\u7528<code>hasNext()<\/code>\u68c0\u67e5\u5e8f\u5217\u4e2d\u662f\u5426\u8fd8\u6709\u5143\u7d20\u3002<\/p>\n\n\n\n<p>4.\u4f7f\u7528<code>remove()<\/code>\u5c06\u8fed\u4ee3\u5668\u65b0\u8fd4\u56de\u7684\u5143\u7d20\u5220\u9664\u3002<\/p>\n\n\n\n<p><code>Iterator<\/code>\u662fJava\u8fed\u4ee3\u5668\u6700\u7b80\u5355\u7684\u5b9e\u73b0\uff0c\u4e3a<code>List<\/code>\u8bbe\u8ba1\u7684<code>ListIterator<\/code>\u5177\u6709\u66f4\u591a\u7684\u529f\u80fd\uff0c\u5b83\u53ef\u4ee5\u4ece\u4e24\u4e2a\u65b9\u5411\u904d\u5386<code>List<\/code>\uff0c\u4e5f\u53ef\u4ee5\u4ece<code>List<\/code>\u4e2d\u63d2\u5165\u548c\u5220\u9664\u5143\u7d20\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">TREESET\u7c7b<\/h3>\n\n\n\n<p><code>TreeSet<\/code>\u91c7\u7528\u6811\u7ed3\u6784\u6765\u5b58\u50a8\u6570\u636e\uff0c\u5b83\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u6210\u4e3a\u4e00\u4e2a\u8282\u70b9\uff0c\u8282\u70b9\u4f1a\u6309\u7167\u5176\u5b58\u653e\u6570\u636e\u7684\u201c\u5927\u5c0f\u201d\u987a\u5e8f\uff0c\u4e00\u5c42\u4e00\u5c42\u5730\u4f9d\u6b21\u6392\u5217\uff0c\u5bf9\u4e8e\u540c\u4e00\u5c42\u4e2d\u7684\u8282\u70b9\u4ece\u5de6\u5230\u53f3\u6309\u201c\u5927\u5c0f\u201d\u987a\u5e8f\u9012\u589e\u6392\u5217\uff0c\u4e0b\u4e00\u5c42\u7684\u90fd\u6bd4\u4e0a\u4e00\u5c42\u7684\u5c0f\u3002<\/p>\n\n\n\n<p><code>TreeSet<\/code>\u7c7b\u5b9e\u73b0\u4e86<code>SortedSet<\/code>\u63a5\u53e3\uff0c\u80fd\u591f\u5bf9\u96c6\u5408\u4e2d\u7684\u5bf9\u8c61\u8fdb\u884c\u6392\u5e8f<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;package collection.set;<br>&nbsp;import java.util.*;<br>&nbsp;public class HashSetComp2 {<br>&nbsp;    public static void main(String[] args) {<br>&nbsp;        Set&lt;Integer&gt; set = new TreeSet&lt;Integer&gt;();<br>&nbsp;        set.add(new Integer(8));<br>&nbsp;        set.add(new Integer(6));<br>&nbsp;        set.add(new Integer(7));<br>&nbsp;        Iterator&lt;Integer&gt; it = set.iterator();<br>&nbsp;        while (it.hasNext()) {<br>&nbsp;         &nbsp; &nbsp; System.out.println(it.next() + \" \");<br>&nbsp;        }<br>&nbsp;    }<br>&nbsp;}<\/pre>\n\n\n\n<p>\u5f53\u5411\u96c6\u5408\u4e2d\u52a0\u5165\u4e00\u4e2a\u5bf9\u8c61\u65f6\uff0c\u4f1a\u628a\u5b83\u63d2\u5165\u5230\u6709\u5e8f\u7684\u5bf9\u8c61\u96c6\u5408\u4e2d\u3002<\/p>\n\n\n\n<p><code>TreeSet<\/code>\u652f\u6301\u6765\u4e24\u79cd\u6392\u5e8f\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<p>\u00d8\u81ea\u7136\u6392\u5e8f<\/p>\n\n\n\n<p>\u00d8\u5ba2\u6237\u5316\u6392\u5e8f<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u91c7\u7528<strong>\u81ea\u7136\u6392\u5e8f<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>\u81ea\u7136\u6392\u5e8f<\/strong><\/h3>\n\n\n\n<p>\u5728JDK\u7c7b\u5e93\u4e2d\uff0c\u6709\u4e00\u90e8\u5206\u7c7b\u5b9e\u73b0<code>Comparable<\/code>\u63a5\u53e3\uff0c\u5982<code>Integer<\/code>\u3001<code>Double<\/code>\u548c<code>String<\/code>\u7b49<\/p>\n\n\n\n<p><code>Comparable<\/code>\u63a5\u53e3\u6709\u4e00\u4e2a<code>compareTo(Object o)<\/code>\u65b9\u6cd5\uff0c\u5b83\u8fd4\u56de\u6574\u6570\u7c7b\u578b\u3002<\/p>\n\n\n\n<p>\u5bf9\u4e8e\u8868\u8fbe\u5f0f<code>x.compareTo(y)<\/code>\uff0c<\/p>\n\n\n\n<p>\u00d8\u5982\u679c\u8fd4\u56de\u503c\u4e3a0\uff0c\u5219\u8868\u793ax\u548cy\u76f8\u7b49<\/p>\n\n\n\n<p>\u00d8\u5982\u679c\u8fd4\u56de\u503c\u5927\u4e8e0\uff0c\u5219\u8868\u793ax\u5927\u4e8ey<\/p>\n\n\n\n<p>\u00d8\u5982\u679c\u8fd4\u56de\u503c\u5c0f\u4e8e0\uff0c\u5219\u8868\u793ax\u5c0f\u4e8ey<\/p>\n\n\n\n<p><code>TreeSet<\/code>\u8c03\u7528\u5bf9\u8c61\u7684<code>compareTo()<\/code>\u65b9\u6cd5\u6bd4\u8f83\u96c6\u5408\u4e2d\u5bf9\u8c61\u7684\u5927\u5c0f\uff0c\u7136\u540e\u8fdb\u884c\u5347\u5e8f\u6392\u5217\uff0c\u8fd9\u79cd\u65b9\u5f0f\u79f0\u4e3a\u81ea\u7136\u6392\u5e8f\u3002<\/p>\n\n\n\n<p>\u6b63\u5e38\u662f\u6309\u5347\u5e8f\u6392\u5217\uff0c\u5728\u8fd4\u56de\u524d\u9762\u52a0\u4e2a\u8d1f\u53f7\u5c31\u53ef\u4ee5\u964d\u5e8f\u6392\u5217<\/p>\n\n\n\n<p>JDK\u7c7b\u5e93\u4e2d\u5b9e\u73b0\u4e86<code>Comparable<\/code>\u63a5\u53e3\u7684\u4e00\u4e9b\u7c7b\u7684\u6392\u5e8f\u65b9\u5f0f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"\"><thead><tr><th>  \u7c7b  <\/th><th>  \u6392\u5e8f  <\/th><\/tr><\/thead><tbody><tr><td>  Byte\u3001Double\u3001Float\u3001Integer\u3001Long\u3001Short  <\/td><td>  \u6309\u6570\u5b57\u5927\u5c0f\u6392\u5e8f  <\/td><\/tr><tr><td>  Character  <\/td><td>  \u6309\u5b57\u7b26Unicode\u503c\u7684\u5927\u5c0f\u6392\u5e8f  <\/td><\/tr><tr><td>  String  <\/td><td>  \u6309\u5b57\u7b26\u4e32\u4e2d\u5b57\u7b26\u7684Unicode\u503c\u7684\u5927\u5c0f\u6392\u5e8f  <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u4f7f\u7528\u81ea\u7136\u6392\u5e8f\u65f6\uff0c\u53ea\u80fd\u5411<code>TreeSet<\/code>\u96c6\u5408\u4e2d\u52a0\u5165\u540c\u4e00\u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u5e76\u4e14\u8fd9\u4e9b\u5bf9\u8c61\u5fc5\u987b\u5b9e\u73b0<code>Comparable<\/code>\u63a5\u53e3\u3002<\/p>\n\n\n\n<p><code>compareTo<\/code>\u8fd4\u56de\u7c7b\u578b\u5fc5\u987b\u662f<code>int<\/code>\u7c7b\u578b\uff0c\u5426\u5219\u7cfb\u7edf\u5c06\u5224\u65ad\u8fd9\u662f\u4e00\u4e2a\u65b0\u51fd\u6570\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">&nbsp;package collection.set;<br>&nbsp;import java.util.*;<br>&nbsp;class Point implements Comparable{<br>&nbsp;    private int x;<br>&nbsp;    private int y;<br>&nbsp;    public Point(int x,int y){<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; this.x=x;<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;this.y=y;<br>&nbsp;    }<br>&nbsp;    public String toString(){<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return \"&lt;\"+x+\",\"+y+\"&gt;\";<br>&nbsp;    }<br>&nbsp;    public int compareTo(Object obj){<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(obj instanceof Point){<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Point p=(Point)obj;<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return (x*1000+y)-(p.x*1000+p.y);<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  }else{<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return -1;<br>&nbsp;}}}<br>&nbsp;public class HashSetPointComp1 {<br>&nbsp;    public static void main(String[] args) {<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Set&lt;Point&gt; s=new TreeSet&lt;Point&gt;();<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s.add(new Point(2,1));<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s.add(new Point(1,1));<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s.add(new Point(2,2));<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;s.add(new Point(1,2));<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Iterator&lt;Point&gt; it=s.iterator();<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;while(it.hasNext()){<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Point p=it.next();<br>&nbsp;     &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;System.out.println(p.toString());<br>&nbsp;}}}<br>&nbsp;\u200b<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5199\u5230\u535a\u5ba2\u91cc\u4e86\uff0c\u6211\u5c31\u4f1a\u4e86\uff08\u786e\u4fe1\uff09<\/p>\n","protected":false},"author":1,"featured_media":292,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[15],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/posts\/219"}],"collection":[{"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=219"}],"version-history":[{"count":10,"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/posts\/219\/revisions"}],"predecessor-version":[{"id":293,"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/posts\/219\/revisions\/293"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/media\/292"}],"wp:attachment":[{"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=219"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=219"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.mhrooz.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=219"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}