{"id":73344,"date":"2026-02-07T15:09:17","date_gmt":"2026-02-07T07:09:17","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/73344.html"},"modified":"2026-02-07T15:09:17","modified_gmt":"2026-02-07T07:09:17","slug":"2026java%e5%90%8e%e7%ab%af%e9%9d%a2%e8%af%95%ef%bc%9a%e9%ab%98%e9%a2%91%e7%9c%9f%e9%a2%98500%e9%81%93%e7%ad%94%e6%a1%88%e8%a7%a3%e6%9e%90%ef%bc%88%e8%a7%86%e9%a2%91%e8%ae%b2%e8%a7%a3%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/73344.html","title":{"rendered":"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09"},"content":{"rendered":"<p>\u6587\u7ae0\u5bfc\u8bfb&#xff1a;\u672c\u6587\u6574\u7406\u4e862026\u5e74Java\u540e\u7aef\u9762\u8bd5\u4e2d\u6700\u5e38\u51fa\u73b0\u7684500\u9053\u9ad8\u9891\u771f\u9898&#xff0c;\u6db5\u76d6Java\u57fa\u7840\u3001\u96c6\u5408\u6846\u67b6\u3001\u591a\u7ebf\u7a0b\u3001JVM\u3001Spring\u5168\u5bb6\u6876\u3001MySQL\u3001Redis\u3001\u5206\u5e03\u5f0f\u7b49\u6838\u5fc3\u6a21\u5757\u3002\u5efa\u8bae\u6536\u85cf\u5907\u7528&#xff0c;\u6587\u672b\u9644\u5b8c\u6574\u8d44\u6e90\u4e0b\u8f7d\u3002<\/p>\n<h4>\u4e00\u3001Java\u57fa\u7840\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09;<\/h4>\n<h5>1.1 \u9762\u5411\u5bf9\u8c61\u4e09\u5927\u7279\u6027<\/h5>\n<p>\/\/ class\u5b9a\u4e49\u7c7b\u5173\u952e\u5b57 &#8211; \u7528\u4e8e\u521b\u5efa\u5bf9\u8c61\u7684\u84dd\u56fe\u6a21\u677f<br \/>\npublic class Animal {<br \/>\n    \/\/ private\u79c1\u6709\u8bbf\u95ee\u4fee\u9970\u7b26 &#8211; \u53ea\u5141\u8bb8\u5728\u672c\u7c7b\u5185\u90e8\u8bbf\u95ee&#xff0c;\u5c01\u88c5\u7279\u6027\u4f53\u73b0<br \/>\n    private String name;<\/p>\n<p>    \/\/ protected\u53d7\u4fdd\u62a4\u4fee\u9970\u7b26 &#8211; \u5141\u8bb8\u5b50\u7c7b\u548c\u540c\u5305\u7c7b\u8bbf\u95ee<br \/>\n    protected int age;<\/p>\n<p>    \/\/ public\u516c\u5171\u4fee\u9970\u7b26 &#8211; \u4efb\u4f55\u5730\u65b9\u90fd\u53ef\u8bbf\u95ee<br \/>\n    public void eat() {<br \/>\n        System.out.println(&#034;\u52a8\u7269\u8fdb\u98df&#034;);<br \/>\n    }<\/p>\n<p>    \/\/ getter\u65b9\u6cd5 &#8211; \u7528\u4e8e\u83b7\u53d6\u79c1\u6709\u5c5e\u6027\u503c&#xff0c;\u63a7\u5236\u5916\u90e8\u8bbf\u95ee<br \/>\n    public String getName() {<br \/>\n        return name;<br \/>\n    }<\/p>\n<p>    \/\/ setter\u65b9\u6cd5 &#8211; \u7528\u4e8e\u8bbe\u7f6e\u79c1\u6709\u5c5e\u6027\u503c&#xff0c;\u53ef\u5728\u65b9\u6cd5\u5185\u6dfb\u52a0\u6821\u9a8c\u903b\u8f91<br \/>\n    public void setName(String name) {<br \/>\n        \/\/ this\u5173\u952e\u5b57 &#8211; \u6307\u4ee3\u5f53\u524d\u5bf9\u8c61\u5b9e\u4f8b&#xff0c;\u533a\u5206\u6210\u5458\u53d8\u91cf\u548c\u53c2\u6570\u540d<br \/>\n        this.name &#061; name;<br \/>\n    }<br \/>\n} <\/p>\n<p>\u9762\u8bd5\u9898&#xff1a;\u8c08\u8c08\u4f60\u5bf9\u9762\u5411\u5bf9\u8c61\u4e09\u5927\u7279\u6027\u7684\u7406\u89e3&#xff1f;<\/p>\n<p>\u6838\u5fc3\u7b54\u6848&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u5c01\u88c5&#xff1a;\u9690\u85cf\u5185\u90e8\u5b9e\u73b0&#xff0c;\u66b4\u9732\u516c\u5171\u63a5\u53e3&#xff0c;\u63d0\u9ad8\u5b89\u5168\u6027<\/p>\n<\/li>\n<li>\n<p>\u7ee7\u627f&#xff1a;\u590d\u7528\u7236\u7c7b\u4ee3\u7801&#xff0c;\u5efa\u7acb\u7c7b\u4e4b\u95f4\u7684\u5c42\u6b21\u5173\u7cfb<\/p>\n<\/li>\n<li>\n<p>\u591a\u6001&#xff1a;\u540c\u4e00\u63a5\u53e3\u4e0d\u540c\u5b9e\u73b0&#xff0c;\u589e\u5f3a\u7a0b\u5e8f\u6269\u5c55\u6027<\/p>\n<\/li>\n<\/ul>\n<h5>1.2 String\u3001StringBuilder\u3001StringBuffer\u533a\u522b<\/h5>\n<p>\/\/ String\u7c7b &#8211; \u5b57\u7b26\u4e32\u5e38\u91cf&#xff0c;\u4e0d\u53ef\u53d8\u5bf9\u8c61&#xff0c;\u6bcf\u6b21\u4fee\u6539\u90fd\u521b\u5efa\u65b0\u5bf9\u8c61<br \/>\nString str &#061; &#034;hello&#034;;<br \/>\nstr &#061; str &#043; &#034; world&#034;; \/\/ \u8fd9\u91cc\u521b\u5efa\u4e86\u65b0\u7684String\u5bf9\u8c61&#xff0c;\u539f\u5bf9\u8c61\u88ab\u4e22\u5f03<\/p>\n<p>\/\/ StringBuilder &#8211; \u53ef\u53d8\u5b57\u7b26\u4e32&#xff0c;\u5355\u7ebf\u7a0b\u73af\u5883\u4e0b\u4f7f\u7528&#xff0c;\u6548\u7387\u6700\u9ad8<br \/>\n\/\/ StringBuilder\u5b57\u7b26\u4e32\u6784\u5efa\u5668 &#8211; \u9002\u5408\u9891\u7e41\u4fee\u6539\u5b57\u7b26\u4e32\u5185\u5bb9&#xff0c;\u7ebf\u7a0b\u4e0d\u5b89\u5168\u4f46\u901f\u5ea6\u5feb<br \/>\nStringBuilder sb &#061; new StringBuilder();<br \/>\nsb.append(&#034;hello&#034;); \/\/ append\u8ffd\u52a0\u65b9\u6cd5 &#8211; \u5728\u672b\u5c3e\u6dfb\u52a0\u5185\u5bb9&#xff0c;\u4e0d\u521b\u5efa\u65b0\u5bf9\u8c61<br \/>\nsb.append(&#034; world&#034;);<\/p>\n<p>\/\/ StringBuffer &#8211; \u53ef\u53d8\u5b57\u7b26\u4e32&#xff0c;\u591a\u7ebf\u7a0b\u5b89\u5168&#xff0c;\u6548\u7387\u7565\u4f4e\u4e8eStringBuilder<br \/>\n\/\/ StringBuffer\u5b57\u7b26\u4e32\u7f13\u51b2\u533a &#8211; \u5185\u90e8\u4f7f\u7528synchronized\u5173\u952e\u5b57\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168<br \/>\nStringBuffer sbf &#061; new StringBuffer();<br \/>\nsbf.append(&#034;hello&#034;).append(&#034; world&#034;); \/\/ \u652f\u6301\u94fe\u5f0f\u8c03\u7528 <\/p>\n<p>\u9762\u8bd5\u8003\u70b9\u603b\u7ed3&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"182\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260207070915-6986e51bd5823.png\" width=\"509\" \/><\/p>\n<\/p>\n<h4>\u4e8c\u3001\u96c6\u5408\u6846\u67b6\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09;<\/h4>\n<h5>2.1 HashMap\u5e95\u5c42\u539f\u7406&#xff08;\u5fc5\u8003&#xff09;<\/h5>\n<p>\/\/ HashMap\u54c8\u5e0c\u6620\u5c04 &#8211; \u57fa\u4e8e\u54c8\u5e0c\u8868\u5b9e\u73b0\u7684\u53cc\u5217\u96c6\u5408&#xff0c;\u5b58\u50a8\u952e\u503c\u5bf9\u6570\u636e<br \/>\n\/\/ \u5141\u8bb8null\u952e\u548cnull\u503c&#xff0c;\u7ebf\u7a0b\u4e0d\u5b89\u5168&#xff0c;\u67e5\u8be2\u65f6\u95f4\u590d\u6742\u5ea6O(1)<br \/>\nHashMap&lt;String, Integer&gt; map &#061; new HashMap&lt;&gt;();<\/p>\n<p>\/\/ put\u6dfb\u52a0\u65b9\u6cd5 &#8211; \u5c06\u952e\u503c\u5bf9\u5b58\u5165\u96c6\u5408<br \/>\nmap.put(&#034;java&#034;, 1);<br \/>\nmap.put(&#034;python&#034;, 2);<\/p>\n<p>\/\/ get\u83b7\u53d6\u65b9\u6cd5 &#8211; \u6839\u636e\u952e\u83b7\u53d6\u5bf9\u5e94\u7684\u503c<br \/>\nInteger value &#061; map.get(&#034;java&#034;);<br \/>\nJDK7&#xff1a;\u6570\u7ec4 &#043; \u94fe\u8868<br \/>\nJDK8&#xff1a;\u6570\u7ec4 &#043; \u94fe\u8868 &#043; \u7ea2\u9ed1\u6811&#xff08;\u5f53\u94fe\u8868\u957f\u5ea6\u22658\u4e14\u6570\u7ec4\u957f\u5ea6\u226564\u65f6\u8f6c\u6362&#xff09;<\/p>\n<p>put()\u6267\u884c\u6d41\u7a0b&#xff1a;<br \/>\n1. \u8ba1\u7b97key\u7684hash\u503c&#xff1a;(h &#061; key.hashCode()) ^ (h &gt;&gt;&gt; 16)<br \/>\n2. \u901a\u8fc7(n-1)&amp;hash\u8ba1\u7b97\u6570\u7ec4\u7d22\u5f15<br \/>\n3. \u65e0\u51b2\u7a81\u76f4\u63a5\u5b58\u5165&#xff1b;\u6709\u51b2\u7a81\u91c7\u7528\u62c9\u94fe\u6cd5\u89e3\u51b3<br \/>\n4. \u94fe\u8868\u957f\u5ea6\u22658\u8f6c\u7ea2\u9ed1\u6811&#xff0c;\u63d0\u5347\u67e5\u8be2\u6548\u7387 <\/p>\n<p>\u9ad8\u9891\u8ffd\u95ee&#xff1a;HashMap\u4e3a\u4ec0\u4e48\u7ebf\u7a0b\u4e0d\u5b89\u5168&#xff1f;\u5982\u4f55\u89e3\u51b3&#xff1f;<\/p>\n<p>\u7b54\u6848&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u591a\u7ebf\u7a0b\u4e0b\u53ef\u80fd\u51fa\u73b0\u6570\u636e\u8986\u76d6&#xff08;put\u65f6\u672a\u540c\u6b65&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u6269\u5bb9\u65f6\u53ef\u80fd\u5f62\u6210\u73af\u5f62\u94fe\u8868\u5bfc\u81f4\u6b7b\u5faa\u73af&#xff08;JDK7&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u89e3\u51b3\u65b9\u6848&#xff1a;\u4f7f\u7528ConcurrentHashMap&#xff08;\u63a8\u8350&#xff09;\u3001Collections.synchronizedMap()<\/p>\n<\/li>\n<\/ul>\n<h5>2.2 ConcurrentHashMap\u7ebf\u7a0b\u5b89\u5168\u5b9e\u73b0<\/h5>\n<p>\/\/ ConcurrentHashMap\u5e76\u53d1\u54c8\u5e0c\u6620\u5c04 &#8211; \u7ebf\u7a0b\u5b89\u5168\u7684HashMap&#xff0c;\u9ad8\u5e76\u53d1\u6027\u80fd\u4f18\u5f02<br \/>\n\/\/ JDK7\u91c7\u7528\u5206\u6bb5\u9501&#xff08;Segment&#xff09;&#xff0c;JDK8\u91c7\u7528CAS&#043;synchronized<\/p>\n<p>ConcurrentHashMap&lt;String, String&gt; concurrentMap &#061; new ConcurrentHashMap&lt;&gt;();<br \/>\nconcurrentMap.put(&#034;key&#034;, &#034;value&#034;);<\/p>\n<p>\/\/ \u5206\u6bb5\u9501\u539f\u7406 &#8211; \u5c06\u6570\u636e\u5206\u621016\u4e2a\u6bb5&#xff0c;\u6bcf\u6bb5\u72ec\u7acb\u52a0\u9501&#xff0c;\u4e0d\u540c\u6bb5\u53ef\u5e76\u53d1\u8bbf\u95ee<br \/>\n\/\/ CAS\u7b97\u6cd5 &#8211; Compare And Swap\u6bd4\u8f83\u5e76\u4ea4\u6362&#xff0c;\u65e0\u9501\u4e50\u89c2\u9501\u5b9e\u73b0 <\/p>\n<p>JDK8\u4f18\u5316\u4eae\u70b9&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u53d6\u6d88Segment&#xff0c;\u76f4\u63a5\u7528Node\u6570\u7ec4&#043;\u94fe\u8868\/\u7ea2\u9ed1\u6811<\/p>\n<\/li>\n<li>\n<p>\u9501\u7c92\u5ea6\u7ec6\u5316\u5230\u6876\u7ea7\u522b&#xff08;\u94fe\u8868\u5934\u8282\u70b9&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u4f7f\u7528CAS\u63a7\u5236\u6269\u5bb9&#xff0c;\u63d0\u5347\u5e76\u53d1\u5ea6<\/p>\n<\/li>\n<\/ul>\n<h4>\u4e09\u3001\u591a\u7ebf\u7a0b\u4e0e\u5e76\u53d1\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09;<\/h4>\n<h5>3.1 synchronized\u5173\u952e\u5b57\u5e95\u5c42\u539f\u7406<\/h5>\n<p>\/\/ synchronized\u540c\u6b65\u9501 &#8211; \u4fdd\u8bc1\u591a\u7ebf\u7a0b\u73af\u5883\u4e0b\u4ee3\u7801\u5757\u6216\u65b9\u6cd5\u7684\u4e92\u65a5\u8bbf\u95ee<br \/>\npublic class SynchronizedDemo {<\/p>\n<p>    \/\/ \u4fee\u9970\u5b9e\u4f8b\u65b9\u6cd5 &#8211; \u9501\u5bf9\u8c61\u662f\u5f53\u524d\u5b9e\u4f8b&#xff08;this&#xff09;<br \/>\n    public synchronized void method1() {<br \/>\n        \/\/ \u4e34\u754c\u533a\u4ee3\u7801 &#8211; \u540c\u65f6\u53ea\u5141\u8bb8\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c<br \/>\n    }<\/p>\n<p>    \/\/ \u4fee\u9970\u9759\u6001\u65b9\u6cd5 &#8211; \u9501\u5bf9\u8c61\u662f\u5f53\u524d\u7c7b\u7684Class\u5bf9\u8c61<br \/>\n    public static synchronized void method2() {<br \/>\n        \/\/ \u9759\u6001\u540c\u6b65\u65b9\u6cd5\u9501 &#8211; \u540c\u4e00\u65f6\u523b\u53ea\u6709\u4e00\u4e2a\u7ebf\u7a0b\u80fd\u6267\u884c\u8be5\u7c7b\u7684\u6b64\u65b9\u6cd5<br \/>\n    }<\/p>\n<p>    \/\/ \u4fee\u9970\u4ee3\u7801\u5757 &#8211; \u7075\u6d3b\u6307\u5b9a\u9501\u5bf9\u8c61<br \/>\n    public void method3() {<br \/>\n        \/\/ Object\u5bf9\u8c61\u9501 &#8211; \u53ef\u4ee5\u662f\u4efb\u610f\u5bf9\u8c61&#xff0c;\u4f5c\u4e3a\u540c\u6b65\u7684\u76d1\u89c6\u5668<br \/>\n        Object lock &#061; new Object();<\/p>\n<p>        \/\/ synchronized\u4ee3\u7801\u5757 &#8211; \u53ea\u9501\u5b9a\u82b1\u62ec\u53f7\u5185\u7684\u4ee3\u7801&#xff0c;\u7c92\u5ea6\u66f4\u7ec6&#xff0c;\u6027\u80fd\u66f4\u597d<br \/>\n        synchronized(lock) {<br \/>\n            System.out.println(&#034;\u540c\u6b65\u4ee3\u7801\u5757\u6267\u884c&#034;);<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<p>\u5e95\u5c42\u5b9e\u73b0&#xff08;JVM\u5c42\u9762&#xff09;&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u540c\u6b65\u4ee3\u7801\u5757&#xff1a;monitorenter &#043; monitorexit \u6307\u4ee4<\/p>\n<\/li>\n<li>\n<p>\u540c\u6b65\u65b9\u6cd5&#xff1a;ACC_SYNCHRONIZED \u8bbf\u95ee\u6807\u5fd7<\/p>\n<\/li>\n<li>\n<p>\u9501\u5347\u7ea7\u8fc7\u7a0b&#xff1a;\u65e0\u9501 \u2192 \u504f\u5411\u9501 \u2192 \u8f7b\u91cf\u7ea7\u9501 \u2192 \u91cd\u91cf\u7ea7\u9501<\/p>\n<\/li>\n<\/ul>\n<h5><\/h5>\n<h5>3.2 volatile\u5173\u952e\u5b57\u4f5c\u7528<\/h5>\n<p>\/\/ volatile\u6613\u53d8\u5173\u952e\u5b57 &#8211; \u4fdd\u8bc1\u53d8\u91cf\u5bf9\u6240\u6709\u7ebf\u7a0b\u7684\u53ef\u89c1\u6027&#xff0c;\u7981\u6b62\u6307\u4ee4\u91cd\u6392\u5e8f<br \/>\npublic class VolatileDemo {<br \/>\n    \/\/ \u4e0d\u4f7f\u7528volatile\u65f6&#xff0c;\u7ebf\u7a0b\u53ef\u80fd\u8bfb\u53d6\u5230\u672c\u5730\u7f13\u5b58\u7684\u65e7\u503c<br \/>\n    \/\/ \u4f7f\u7528volatile\u540e&#xff0c;\u5f3a\u5236\u4ece\u4e3b\u5185\u5b58\u8bfb\u53d6\u6700\u65b0\u503c<br \/>\n    private volatile boolean flag &#061; false;<\/p>\n<p>    public void shutdown() {<br \/>\n        flag &#061; true; \/\/ \u5199\u64cd\u4f5c\u7acb\u5373\u5237\u65b0\u5230\u4e3b\u5185\u5b58<br \/>\n    }<\/p>\n<p>    public void doWork() {<br \/>\n        while(!flag) {<br \/>\n            \/\/ \u8bfb\u64cd\u4f5c\u5f3a\u5236\u4ece\u4e3b\u5185\u5b58\u83b7\u53d6&#xff0c;\u4e0d\u4f1a\u4f7f\u7528\u7ebf\u7a0b\u672c\u5730\u7f13\u5b58<br \/>\n        }<br \/>\n    }<br \/>\n} <\/p>\n<p>\u4e09\u5927\u7279\u6027&#xff1a;<\/p>\n<li>\n<p>\u53ef\u89c1\u6027&#xff1a;\u4e00\u4e2a\u7ebf\u7a0b\u4fee\u6539&#xff0c;\u5176\u4ed6\u7ebf\u7a0b\u7acb\u5373\u53ef\u89c1<\/p>\n<\/li>\n<li>\n<p>\u7981\u6b62\u6307\u4ee4\u91cd\u6392&#xff1a;\u4fdd\u8bc1\u7a0b\u5e8f\u6267\u884c\u987a\u5e8f<\/p>\n<\/li>\n<li>\n<p>\u4e0d\u4fdd\u8bc1\u539f\u5b50\u6027&#xff1a;\u590d\u5408\u64cd\u4f5c&#xff08;\u5982i&#043;&#043;&#xff09;\u4ecd\u9700\u540c\u6b65<\/p>\n<\/li>\n<h4><\/h4>\n<h4>\u56db\u3001JVM\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u56db\u9897\u661f&#xff09;<\/h4>\n<h5>4.1 JVM\u5185\u5b58\u6a21\u578b<\/h5>\n<p>\u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510<br \/>\n\u2502      \u5806&#xff08;Heap&#xff09;    \u2502 \u2190 \u6240\u6709\u7ebf\u7a0b\u5171\u4eab&#xff0c;\u5b58\u653e\u5bf9\u8c61\u5b9e\u4f8b<br \/>\n\u2502  \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u250c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510    \u2502<br \/>\n\u2502  \u2502   \u65b0\u751f\u4ee3     \u2502    \u2502   \u8001\u5e74\u4ee3     \u2502    \u2502<br \/>\n\u2502  \u2502  (Young)    \u2502    \u2502   (Old)     \u2502    \u2502<br \/>\n\u2502  \u2502 Eden:From:To\u2502    \u2502             \u2502    \u2502<br \/>\n\u2502  \u2502  8:1:1      \u2502    \u2502             \u2502    \u2502<br \/>\n\u2502  \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518    \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502  \u865a\u62df\u673a\u6808&#xff08;VM Stack&#xff09; \u2190 \u7ebf\u7a0b\u79c1\u6709&#xff0c;\u65b9\u6cd5\u6267\u884c\u7684\u5185\u5b58\u6a21\u578b  \u2502<br \/>\n\u2502  \u672c\u5730\u65b9\u6cd5\u6808&#xff08;Native Stack&#xff09;\u2190 \u672c\u5730\u65b9\u6cd5\u670d\u52a1            \u2502<br \/>\n\u2502  \u7a0b\u5e8f\u8ba1\u6570\u5668&#xff08;PC Register&#xff09;\u2190 \u5f53\u524d\u7ebf\u7a0b\u6267\u884c\u7684\u5b57\u8282\u7801\u884c\u53f7  \u2502<br \/>\n\u251c\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524<br \/>\n\u2502  \u5143\u7a7a\u95f4&#xff08;Metaspace&#xff09;\u2190 JDK8\u53d6\u4ee3\u6c38\u4e45\u4ee3&#xff0c;\u5b58\u50a8\u7c7b\u5143\u6570\u636e   \u2502<br \/>\n\u2502  \u76f4\u63a5\u5185\u5b58&#xff08;Direct Memory&#xff09;\u2190 NIO\u4f7f\u7528\u7684\u5806\u5916\u5185\u5b58       \u2502<br \/>\n\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518 <\/p>\n<p>\u5783\u573e\u56de\u6536\u7b97\u6cd5\u5bf9\u6bd4&#xff1a;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"174\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260207070915-6986e51beab2d.png\" width=\"377\" \/><\/p>\n<\/p>\n<h5>4.2 \u7c7b\u52a0\u8f7d\u673a\u5236<\/h5>\n<p>\u7c7b\u52a0\u8f7d\u6d41\u7a0b&#xff08;\u53cc\u4eb2\u59d4\u6d3e\u6a21\u578b&#xff09;&#xff1a;<br \/>\n\u81ea\u5b9a\u4e49\u7c7b\u52a0\u8f7d\u5668<br \/>\n    \u2191<br \/>\n\u6269\u5c55\u7c7b\u52a0\u8f7d\u5668&#xff08;Extension&#xff09;\u2190 \u52a0\u8f7d&lt;JAVA_HOME&gt;\/lib\/ext<br \/>\n    \u2191<br \/>\n\u542f\u52a8\u7c7b\u52a0\u8f7d\u5668&#xff08;Bootstrap&#xff09;\u2190 \u52a0\u8f7d&lt;JAVA_HOME&gt;\/lib<br \/>\n    \u2191<br \/>\n\u5e94\u7528\u7a0b\u5e8f\u7c7b\u52a0\u8f7d\u5668&#xff08;App&#xff09;\u2190 \u52a0\u8f7dclasspath <\/p>\n<p>\u53cc\u4eb2\u59d4\u6d3e\u4f18\u52bf&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u907f\u514d\u7c7b\u91cd\u590d\u52a0\u8f7d<\/p>\n<\/li>\n<li>\n<p>\u4fdd\u8bc1\u6838\u5fc3API\u4e0d\u88ab\u7be1\u6539&#xff08;\u5b89\u5168\u6027&#xff09;<\/p>\n<\/li>\n<\/ul>\n<p>\u6253\u7834\u53cc\u4eb2\u59d4\u6d3e\u7684\u573a\u666f&#xff1a;SPI\u673a\u5236\u3001OSGi\u3001Tomcat\u70ed\u90e8\u7f72<\/p>\n<\/p>\n<h4>\u4e94\u3001Spring\u6846\u67b6\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09;<\/h4>\n<h5>5.1 Spring IOC\u5bb9\u5668\u5de5\u4f5c\u539f\u7406<\/h5>\n<p>\/\/ &#064;Configuration\u914d\u7f6e\u7c7b\u6ce8\u89e3 &#8211; \u6807\u8bc6\u8be5\u7c7b\u4e3aSpring\u914d\u7f6e\u7c7b&#xff0c;\u66ff\u4ee3XML\u914d\u7f6e<br \/>\n&#064;Configuration<br \/>\npublic class AppConfig {<\/p>\n<p>    \/\/ &#064;Bean\u5bf9\u8c61\u6ce8\u89e3 &#8211; \u5c06\u65b9\u6cd5\u8fd4\u56de\u503c\u6ce8\u518c\u4e3aSpring\u5bb9\u5668\u4e2d\u7684Bean<br \/>\n    &#064;Bean<br \/>\n    public UserService userService() {<br \/>\n        return new UserServiceImpl();<br \/>\n    }<br \/>\n}<\/p>\n<p>\/\/ ApplicationContext\u5e94\u7528\u4e0a\u4e0b\u6587 &#8211; Spring\u7684\u9ad8\u7ea7\u5bb9\u5668&#xff0c;\u7ee7\u627fBeanFactory<br \/>\n\/\/ ClassPathXmlApplicationContext &#8211; \u4ece\u7c7b\u8def\u5f84\u52a0\u8f7dXML\u914d\u7f6e\u7684\u5bb9\u5668\u5b9e\u73b0<br \/>\nApplicationContext context &#061; new AnnotationConfigApplicationContext(AppConfig.class);<\/p>\n<p>\/\/ getBean\u83b7\u53d6Bean\u65b9\u6cd5 &#8211; \u4ece\u5bb9\u5668\u4e2d\u68c0\u7d22\u5df2\u6ce8\u518c\u7684Bean\u5b9e\u4f8b<br \/>\nUserService service &#061; context.getBean(UserService.class); <\/p>\n<p>IOC\u5b9e\u73b0\u6838\u5fc3&#xff1a;<\/p>\n<li>\n<p>\u5b9a\u4f4d&#xff1a;\u901a\u8fc7ResourceLoader\u52a0\u8f7d\u914d\u7f6e\u6587\u4ef6<\/p>\n<\/li>\n<li>\n<p>\u52a0\u8f7d&#xff1a;\u89e3\u6790Bean\u5b9a\u4e49&#xff0c;\u751f\u6210BeanDefinition<\/p>\n<\/li>\n<li>\n<p>\u6ce8\u518c&#xff1a;\u5c06BeanDefinition\u5b58\u5165ConcurrentHashMap<\/p>\n<\/li>\n<li>\n<p>\u5b9e\u4f8b\u5316&#xff1a;\u5229\u7528\u53cd\u5c04\u521b\u5efaBean\u5bf9\u8c61&#xff08;\u5ef6\u8fdf\u52a0\u8f7d\/\u7acb\u5373\u52a0\u8f7d&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u4f9d\u8d56\u6ce8\u5165&#xff1a;\u901a\u8fc7\u6784\u9020\u5668\/Setter\/\u5b57\u6bb5\u6ce8\u5165\u4f9d\u8d56<\/p>\n<\/li>\n<h5>5.2 Spring AOP\u5b9e\u73b0\u539f\u7406<\/h5>\n<p>\/\/ &#064;Aspect\u5207\u9762\u6ce8\u89e3 &#8211; \u58f0\u660e\u8be5\u7c7b\u4e3aAOP\u5207\u9762&#xff0c;\u5305\u542b\u6a2a\u5207\u903b\u8f91<br \/>\n&#064;Aspect<br \/>\n&#064;Component<br \/>\npublic class LogAspect {<\/p>\n<p>    \/\/ &#064;Pointcut\u5207\u70b9\u8868\u8fbe\u5f0f &#8211; \u5b9a\u4e49\u54ea\u4e9b\u65b9\u6cd5\u9700\u8981\u88ab\u62e6\u622a<br \/>\n    \/\/ execution\u6267\u884c\u8868\u8fbe\u5f0f &#8211; \u5339\u914d\u65b9\u6cd5\u6267\u884c\u8fde\u63a5\u70b9<br \/>\n    &#064;Pointcut(&#034;execution(* com.example.service.*.*(..))&#034;)<br \/>\n    public void servicePointcut() {}<\/p>\n<p>    \/\/ &#064;Before\u524d\u7f6e\u901a\u77e5 &#8211; \u76ee\u6807\u65b9\u6cd5\u6267\u884c\u524d\u6267\u884c<br \/>\n    &#064;Before(&#034;servicePointcut()&#034;)<br \/>\n    public void beforeLog() {<br \/>\n        System.out.println(&#034;\u65b9\u6cd5\u5f00\u59cb\u6267\u884c&#034;);<br \/>\n    }<\/p>\n<p>    \/\/ &#064;Around\u73af\u7ed5\u901a\u77e5 &#8211; \u5305\u56f4\u76ee\u6807\u65b9\u6cd5&#xff0c;\u53ef\u63a7\u5236\u662f\u5426\u6267\u884c\u539f\u65b9\u6cd5<br \/>\n    &#064;Around(&#034;servicePointcut()&#034;)<br \/>\n    public Object aroundLog(ProceedingJoinPoint joinPoint) throws Throwable {<br \/>\n        System.out.println(&#034;\u73af\u7ed5\u524d&#034;);<br \/>\n        \/\/ proceed\u6267\u884c\u539f\u65b9\u6cd5 &#8211; \u8c03\u7528\u76ee\u6807\u65b9\u6cd5\u5e76\u83b7\u53d6\u8fd4\u56de\u503c<br \/>\n        Object result &#061; joinPoint.proceed();<br \/>\n        System.out.println(&#034;\u73af\u7ed5\u540e&#034;);<br \/>\n        return result;<br \/>\n    }<br \/>\n} <\/p>\n<p>AOP\u5e95\u5c42\u5b9e\u73b0&#xff1a;<\/p>\n<ul>\n<li>\n<p>JDK\u52a8\u6001\u4ee3\u7406&#xff1a;\u76ee\u6807\u7c7b\u5b9e\u73b0\u63a5\u53e3\u65f6\u4f7f\u7528<\/p>\n<\/li>\n<li>\n<p>CGLIB\u4ee3\u7406&#xff1a;\u76ee\u6807\u7c7b\u65e0\u63a5\u53e3\u65f6\u4f7f\u7528&#xff0c;\u751f\u6210\u5b50\u7c7b\u4ee3\u7406<\/p>\n<\/li>\n<li>\n<p>\u6267\u884c\u94fe&#xff1a;\u901a\u8fc7\u8d23\u4efb\u94fe\u6a21\u5f0f\u4e32\u8054\u591a\u4e2a\u901a\u77e5<\/p>\n<\/li>\n<\/ul>\n<h4>\u516d\u3001MySQL\u6570\u636e\u5e93\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09;<\/h4>\n<h5>6.1 \u7d22\u5f15\u4f18\u5316\u5b9e\u6218<\/h5>\n<p>&#8212; \u521b\u5efa\u7d22\u5f15\u8bed\u6cd5 &#8211; INDEX\u7d22\u5f15\u5173\u952e\u5b57&#xff0c;\u52a0\u901f\u6570\u636e\u68c0\u7d22<br \/>\n&#8212; UNIQUE\u552f\u4e00\u7d22\u5f15 &#8211; \u786e\u4fdd\u5217\u503c\u4e0d\u91cd\u590d<br \/>\nCREATE UNIQUE INDEX idx_user_phone ON user(phone);<\/p>\n<p>&#8212; \u8054\u5408\u7d22\u5f15 &#8211; \u591a\u5217\u7ec4\u5408\u7d22\u5f15&#xff0c;\u9075\u5faa\u6700\u5de6\u524d\u7f00\u539f\u5219<br \/>\n&#8212; \u6700\u5de6\u524d\u7f00 &#8211; \u67e5\u8be2\u6761\u4ef6\u5fc5\u987b\u4ece\u7d22\u5f15\u6700\u5de6\u5217\u5f00\u59cb&#xff0c;\u5426\u5219\u7d22\u5f15\u5931\u6548<br \/>\nCREATE INDEX idx_name_age ON user(name, age);<\/p>\n<p>&#8212; EXPLAIN\u6267\u884c\u8ba1\u5212 &#8211; \u5206\u6790SQL\u8bed\u53e5\u7684\u6267\u884c\u8fc7\u7a0b\u548c\u7d22\u5f15\u4f7f\u7528\u60c5\u51b5<br \/>\nEXPLAIN SELECT * FROM user WHERE name &#061; &#039;\u5f20\u4e09&#039; AND age &#061; 20; <\/p>\n<p>\u7d22\u5f15\u5931\u6548\u5e38\u89c1\u573a\u666f&#xff1a;<\/p>\n<li>\n<p>\u4f7f\u7528!&#061;\u3001&lt;&gt;\u3001NOT IN\u64cd\u4f5c<\/p>\n<\/li>\n<li>\n<p>\u5bf9\u7d22\u5f15\u5217\u8fdb\u884c\u51fd\u6570\u8fd0\u7b97&#xff08;\u5982WHERE YEAR(create_time) &#061; 2024&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u5b57\u7b26\u4e32\u5b57\u6bb5\u4e0d\u52a0\u5f15\u53f7&#xff08;\u9690\u5f0f\u7c7b\u578b\u8f6c\u6362&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u6a21\u7cca\u67e5\u8be2%\u5728\u5f00\u5934&#xff08;LIKE &#039;%abc&#039;&#xff09;<\/p>\n<\/li>\n<li>\n<p>\u8fdd\u53cd\u6700\u5de6\u524d\u7f00\u539f\u5219<\/p>\n<\/li>\n<h5>6.2 \u4e8b\u52a1\u9694\u79bb\u7ea7\u522b\u4e0eMVCC<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"230\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260207070916-6986e51c0a101.png\" width=\"708\" \/><\/p>\n<p>MVCC\u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236&#xff1a;<\/p>\n<ul>\n<li>\n<p>\u6bcf\u884c\u6570\u636e\u9690\u85cf\u4e24\u4e2a\u5b57\u6bb5&#xff1a;DB_TRX_ID&#xff08;\u4e8b\u52a1ID&#xff09;\u3001DB_ROLL_PTR&#xff08;\u56de\u6eda\u6307\u9488&#xff09;<\/p>\n<\/li>\n<li>\n<p>Undo Log\u5b58\u50a8\u5386\u53f2\u7248\u672c&#xff0c;\u5f62\u6210\u7248\u672c\u94fe<\/p>\n<\/li>\n<li>\n<p>ReadView\u5224\u65ad\u6570\u636e\u53ef\u89c1\u6027&#xff0c;\u5b9e\u73b0\u65e0\u9501\u8bfb<\/p>\n<\/li>\n<\/ul>\n<h4>\u4e03\u3001Redis\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09;<\/h4>\n<h5>7.1 Redis\u6570\u636e\u7c7b\u578b\u4e0e\u5e94\u7528\u573a\u666f<\/h5>\n<p>\/\/ String\u5b57\u7b26\u4e32 &#8211; \u6700\u57fa\u672c\u7c7b\u578b&#xff0c;\u53ef\u5b58\u5b57\u7b26\u4e32\u3001\u6570\u5b57\u3001\u4e8c\u8fdb\u5236<br \/>\n\/\/ \u5e94\u7528\u573a\u666f&#xff1a;\u7f13\u5b58\u3001\u8ba1\u6570\u5668\u3001\u5206\u5e03\u5f0f\u9501<br \/>\nredisTemplate.opsForValue().set(&#034;key&#034;, &#034;value&#034;, Duration.ofMinutes(30));<\/p>\n<p>\/\/ Hash\u54c8\u5e0c &#8211; \u952e\u503c\u5bf9\u96c6\u5408&#xff0c;\u9002\u5408\u5b58\u50a8\u5bf9\u8c61<br \/>\n\/\/ \u5e94\u7528\u573a\u666f&#xff1a;\u7528\u6237\u4fe1\u606f\u3001\u8d2d\u7269\u8f66<br \/>\nredisTemplate.opsForHash().put(&#034;user:1001&#034;, &#034;name&#034;, &#034;\u5f20\u4e09&#034;);<\/p>\n<p>\/\/ List\u5217\u8868 &#8211; \u53cc\u5411\u94fe\u8868&#xff0c;\u652f\u6301\u4e24\u7aef\u64cd\u4f5c<br \/>\n\/\/ \u5e94\u7528\u573a\u666f&#xff1a;\u6d88\u606f\u961f\u5217\u3001\u6700\u65b0N\u6761\u6570\u636e<br \/>\nredisTemplate.opsForList().leftPush(&#034;queue&#034;, &#034;task1&#034;);<\/p>\n<p>\/\/ Set\u96c6\u5408 &#8211; \u65e0\u5e8f\u552f\u4e00\u96c6\u5408<br \/>\n\/\/ \u5e94\u7528\u573a\u666f&#xff1a;\u6807\u7b7e\u3001\u5171\u540c\u597d\u53cb\u3001\u62bd\u5956<br \/>\nredisTemplate.opsForSet().add(&#034;tags&#034;, &#034;java&#034;, &#034;redis&#034;);<\/p>\n<p>\/\/ ZSet\u6709\u5e8f\u96c6\u5408 &#8211; \u5e26\u6743\u91cd\u7684\u96c6\u5408&#xff0c;\u6309\u5206\u6570\u6392\u5e8f<br \/>\n\/\/ \u5e94\u7528\u573a\u666f&#xff1a;\u6392\u884c\u699c\u3001\u5ef6\u8fdf\u961f\u5217<br \/>\nredisTemplate.opsForZSet().add(&#034;rank&#034;, &#034;user1&#034;, 100); <\/p>\n<h5>7.2 \u7f13\u5b58\u7a7f\u900f\u3001\u51fb\u7a7f\u3001\u96ea\u5d29\u89e3\u51b3\u65b9\u6848<\/h5>\n<p><img loading=\"lazy\" decoding=\"async\" alt=\"\" height=\"189\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260207070916-6986e51c19e3c.png\" width=\"615\" \/><\/p>\n<\/p>\n<h4>\u516b\u3001\u9762\u8bd5\u6280\u5de7\u4e0e\u85aa\u8d44\u8c08\u5224<\/h4>\n<p>\u81ea\u6211\u4ecb\u7ecd\u6a21\u677f&#xff08;2\u5206\u949f\u7248&#xff09;&#xff1a;<\/p>\n<p>\u60a8\u597d&#xff0c;\u6211\u53ebXXX&#xff0c;X\u5e74Java\u5f00\u53d1\u7ecf\u9a8c&#xff0c;\u76ee\u524d\u5c31\u804c\u4e8eXX\u516c\u53f8\u62c5\u4efb\u9ad8\u7ea7\u5f00\u53d1\u5de5\u7a0b\u5e08\u3002<br \/>\n\u4e3b\u8981\u8d1f\u8d23&#xff1a;<br \/>\n1. XX\u7cfb\u7edf\u7684\u8bbe\u8ba1\u4e0e\u5f00\u53d1&#xff0c;\u91c7\u7528Spring Cloud\u5fae\u670d\u52a1\u67b6\u6784&#xff0c;\u65e5\u6d3b\u7528\u6237X\u4e07<br \/>\n2. \u4e3b\u5bfc\u4e86XX\u4f18\u5316&#xff0c;\u901a\u8fc7\u5f15\u5165Redis\u7f13\u5b58&#043;MQ\u5f02\u6b65\u5904\u7406&#xff0c;\u63a5\u53e3\u54cd\u5e94\u4ece2s\u964d\u81f3200ms<br \/>\n3. \u53c2\u4e0e\u6280\u672f\u9009\u578b&#xff0c;\u642d\u5efaXX\u76d1\u63a7\u4f53\u7cfb&#xff0c;\u7ebf\u4e0a\u6545\u969c\u53d1\u73b0\u65f6\u95f4\u7f29\u77ed80%<br \/>\n\u6280\u672f\u6808&#xff1a;Java\u3001Spring Boot\u3001Spring Cloud\u3001MySQL\u3001Redis\u3001RocketMQ\u3001Docker<br \/>\n\u671f\u5f85\u52a0\u5165\u8d35\u516c\u53f8&#xff0c;\u8c22\u8c22&#xff01; <\/p>\n<h4>\u4e5d\u3001\u8d44\u6e90\u83b7\u53d6\u65b9\u5f0f<\/h4>\n<p>\u7531\u4e8e\u7bc7\u5e45\u9650\u5236&#xff0c;\u5b8c\u6574\u7248\u8d44\u6599\u5305\u542b&#xff1a;<\/p>\n<p>\u2705 500\u9053\u9ad8\u9891\u9762\u8bd5\u9898&#xff08;\u9644\u8be6\u7ec6\u7b54\u6848\u89e3\u6790&#xff0c;\u975e\u7b80\u5355\u6982\u5ff5&#xff09; \u2705 20\u5f20\u601d\u7ef4\u5bfc\u56fe&#xff08;\u6db5\u76d6\u6240\u6709\u77e5\u8bc6\u6a21\u5757&#xff0c;\u65b9\u4fbf\u8bb0\u5fc6&#xff09; \u2705 50\u9053\u573a\u666f\u8bbe\u8ba1\u9898&#xff08;\u5982\u79d2\u6740\u7cfb\u7edf\u3001IM\u7cfb\u7edf\u67b6\u6784\u8bbe\u8ba1&#xff09; \u2705 2025\u5927\u5382\u771f\u9898\u6c47\u7f16&#xff08;\u5b57\u8282\u3001\u963f\u91cc\u3001\u817e\u8baf\u3001\u7f8e\u56e2\u6700\u65b0\u9762\u7ecf&#xff09; \u2705 \u7b80\u5386\u6a21\u677f&#xff08;\u5df2\u6574\u740620&#043;\u57ce\u5e02\u4e92\u8054\u7f51\u516c\u53f8&#xff09;<\/p>\n<p><span class=\"link-card-box\"><span class=\"link-title\">\u5b58\u5165\u7f51\u76d8&#xff0c;\u81ea\u884c\u83b7\u53d6<\/span><span class=\"link-link\"><img decoding=\"async\" class=\"link-link-icon\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260207070916-6986e51c284c8.png\" \/>https:\/\/pan.quark.cn\/s\/8e41e3029b02<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u5bfc\u8bfb&#xff1a;\u672c\u6587\u6574\u7406\u4e862026\u5e74Java\u540e\u7aef\u9762\u8bd5\u4e2d\u6700\u5e38\u51fa\u73b0\u7684500\u9053\u9ad8\u9891\u771f\u9898&#xff0c;\u6db5\u76d6Java\u57fa\u7840\u3001\u96c6\u5408\u6846\u67b6\u3001\u591a\u7ebf\u7a0b\u3001JVM\u3001Spring\u5168\u5bb6\u6876\u3001MySQL\u3001Redis\u3001\u5206\u5e03\u5f0f\u7b49\u6838\u5fc3\u6a21\u5757\u3002\u5efa\u8bae\u6536\u85cf\u5907\u7528&#xff0c;\u6587\u672b\u9644\u5b8c\u6574\u8d44\u6e90\u4e0b\u8f7d\u3002<br \/>\n\u4e00\u3001Java\u57fa\u7840\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09;<br \/>\n1.1 \u9762\u5411\u5bf9\u8c61\u4e09\u5927\u7279\u6027<br \/>\n\/\/ class\u5b9a\u4e49\u7c7b\u5173\u952e\u5b57 &#8211; \u7528\u4e8e\u521b\u5efa\u5bf9\u8c61\u7684\u84dd\u56fe\u6a21\u677f<br \/>\npublic class Animal {\/\/ <\/p>\n","protected":false},"author":2,"featured_media":73339,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[99,925,176],"topic":[],"class_list":["post-73344","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-java","tag-925","tag-176"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\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.wsisp.com\/helps\/73344.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u5bfc\u8bfb&#xff1a;\u672c\u6587\u6574\u7406\u4e862026\u5e74Java\u540e\u7aef\u9762\u8bd5\u4e2d\u6700\u5e38\u51fa\u73b0\u7684500\u9053\u9ad8\u9891\u771f\u9898&#xff0c;\u6db5\u76d6Java\u57fa\u7840\u3001\u96c6\u5408\u6846\u67b6\u3001\u591a\u7ebf\u7a0b\u3001JVM\u3001Spring\u5168\u5bb6\u6876\u3001MySQL\u3001Redis\u3001\u5206\u5e03\u5f0f\u7b49\u6838\u5fc3\u6a21\u5757\u3002\u5efa\u8bae\u6536\u85cf\u5907\u7528&#xff0c;\u6587\u672b\u9644\u5b8c\u6574\u8d44\u6e90\u4e0b\u8f7d\u3002 \u4e00\u3001Java\u57fa\u7840\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09; 1.1 \u9762\u5411\u5bf9\u8c61\u4e09\u5927\u7279\u6027 \/\/ class\u5b9a\u4e49\u7c7b\u5173\u952e\u5b57 - \u7528\u4e8e\u521b\u5efa\u5bf9\u8c61\u7684\u84dd\u56fe\u6a21\u677f public class Animal {\/\/\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/73344.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-02-07T07:09:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260207070915-6986e51bd5823.png\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/73344.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/73344.html\",\"name\":\"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-02-07T07:09:17+00:00\",\"dateModified\":\"2026-02-07T07:09:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/73344.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/73344.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/73344.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","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.wsisp.com\/helps\/73344.html","og_locale":"zh_CN","og_type":"article","og_title":"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u5bfc\u8bfb&#xff1a;\u672c\u6587\u6574\u7406\u4e862026\u5e74Java\u540e\u7aef\u9762\u8bd5\u4e2d\u6700\u5e38\u51fa\u73b0\u7684500\u9053\u9ad8\u9891\u771f\u9898&#xff0c;\u6db5\u76d6Java\u57fa\u7840\u3001\u96c6\u5408\u6846\u67b6\u3001\u591a\u7ebf\u7a0b\u3001JVM\u3001Spring\u5168\u5bb6\u6876\u3001MySQL\u3001Redis\u3001\u5206\u5e03\u5f0f\u7b49\u6838\u5fc3\u6a21\u5757\u3002\u5efa\u8bae\u6536\u85cf\u5907\u7528&#xff0c;\u6587\u672b\u9644\u5b8c\u6574\u8d44\u6e90\u4e0b\u8f7d\u3002 \u4e00\u3001Java\u57fa\u7840\u7bc7&#xff08;\u9ad8\u9891\u6307\u6570&#xff1a;\u4e94\u9897\u661f&#xff09; 1.1 \u9762\u5411\u5bf9\u8c61\u4e09\u5927\u7279\u6027 \/\/ class\u5b9a\u4e49\u7c7b\u5173\u952e\u5b57 - \u7528\u4e8e\u521b\u5efa\u5bf9\u8c61\u7684\u84dd\u56fe\u6a21\u677f public class Animal {\/\/","og_url":"https:\/\/www.wsisp.com\/helps\/73344.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-02-07T07:09:17+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/02\/20260207070915-6986e51bd5823.png"}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/73344.html","url":"https:\/\/www.wsisp.com\/helps\/73344.html","name":"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-02-07T07:09:17+00:00","dateModified":"2026-02-07T07:09:17+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/73344.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/73344.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/73344.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"2026Java\u540e\u7aef\u9762\u8bd5\uff1a\u9ad8\u9891\u771f\u9898500\u9053+\u7b54\u6848\u89e3\u6790\uff08\u89c6\u9891\u8bb2\u89e3\uff09"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/73344","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=73344"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/73344\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/73339"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=73344"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=73344"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=73344"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=73344"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}