{"rsdb":{"rid":"156000","subhead":"","postdate":"0","aid":"117107","fid":"54","uid":"1","topic":"1","content":"

\u7a0b\u5e8f\u8ba1\u6570\u5668\uff0c\u865a\u62df\u673a\u6808\u548c\u672c\u5730\u65b9\u6cd5\u6808<\/span><\/span><\/span><\/span><\/p>

\u3000\u3000<\/span><\/span>\u9996\u5148\u6211\u4eec\u5148\u6765\u770b\u4e0b\u5783\u573e\u56de\u6536\u4e2d\u4e0d\u4f1a\u7ba1\u7406\u5230\u7684\u5185\u5b58\u533a\u57df\uff0c\u5728Java\u865a\u62df\u673a\u7684\u8fd0\u884c\u65f6\u6570\u636e\u533a\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u7a0b\u5e8f\u8ba1\u6570\u5668\uff0c\u865a\u62df\u673a\u6808\uff0c\u672c\u5730\u65b9\u6cd5\u6808\u8fd9\u4e09\u4e2a\u5730\u65b9\u662f\u6bd4\u8f83\u7279\u522b\u7684\u3002\u8fd9\u4e2a\u4e09\u4e2a\u90e8\u5206\u7684\u7279\u70b9\u5c31\u662f\u7ebf\u7a0b\u79c1\u6709\u7684\uff0c\u5b83\u4eec\u968f\u7740\u7ebf\u7a0b\u7684\u521b\u5efa\u800c\u8bde\u751f\uff0c\u4e5f\u56e0\u7ebf\u7a0b\u7684\u7ed3\u675f\u800c\u706d\u4ea1\u3002\u6808\u4e2d\u7684\u6808\u5e27\u968f\u7740\u65b9\u6cd5\u7684\u8fdb\u5165\u548c\u9000\u51fa\u4f1a\u6709\u6761\u4e0d\u7d6e\u7684\u6267\u884c\u7740\u8fdb\u6808\u548c\u51fa\u6808\u3002\u6bcf\u4e00\u4e2a\u6808\u5e27\u4e2d\u5206\u914d\u591a\u5c11\u5185\u5b58\uff0c\u57fa\u672c\u4e0a\u662f\u5728\u7c7b\u7ed3\u6784\u786e\u8ba4\u4e0b\u6765\u7684\u65f6\u5019\u5c31\u5df2\u77e5\u7684\uff0c\u56e0\u6b64\u8fd9\u51e0\u4e2a\u533a\u57df\u7684\u5185\u5b58\u5206\u914d\u548c\u56de\u6536\u90fd\u5177\u5907\u786e\u5b9a\u6027\uff0c\u5728\u8fd9\u51e0\u4e2a\u533a\u57df\u5185\u5c31\u4e0d\u9700\u8981\u8fc7\u591a\u8003\u8651\u56de\u6536\u7684\u95ee\u9898\uff0c\u56e0\u4e3a\u65b9\u6cd5\u7ed3\u675f\u6216\u8005\u7ebf\u7a0b\u7ed3\u675f\uff0c\u5185\u5b58\u81ea\u7136\u5c31\u8ddf\u968f\u7740\u56de\u6536\u4e86\u3002<\/span><\/span><\/span><\/span><\/span><\/p>

Java\u5806\u548c\u65b9\u6cd5\u533a<\/span><\/span><\/span><\/span><\/span><\/strong><\/p>

\u3000\u3000<\/span><\/span><\/span><\/span><\/span><\/strong>\u6211\u4eec\u8ba8\u8bba\u7684\u5783\u573e\u56de\u6536\uff0c\u4e3b\u8981\u5c31\u662f\u5173\u4e8eJava\u5806\u4e2d\u5e9f\u5f03\u5bf9\u8c61\u7684\u56de\u6536\u3002Java\u5806\u548c\u65b9\u6cd5\u533a\u4e2d\uff0c\u4e00\u4e2a\u63a5\u53e3\u4e2d\u7684\u591a\u4e2a\u5b9e\u73b0\u7c7b\u9700\u8981\u7684\u5185\u5b58\u53ef\u80fd\u4e0d\u4e00\u6837\uff0c\u4e00\u4e2a\u65b9\u6cd5\u4e2d\u7684\u591a\u4e2a\u5206\u652f\u9700\u8981\u7684\u5185\u5b58\u4e5f\u53ef\u80fd\u4e0d\u4e00\u6837\uff0c\u6211\u4eec\u4f1a\u5728\u7a0b\u5e8f\u8fd0\u884c\u7684\u65f6\u5019\u52a8\u6001\u521b\u5efa\u5bf9\u8c61\uff0c\u8fd9\u90e8\u5206\u5185\u5b58\u7684\u5206\u914d\u548c\u56de\u6536\u4e5f\u662f\u52a8\u6001\u7684\uff0c\u5783\u573e\u6536\u96c6\u5668\u6240\u5173\u6ce8\u7684\u662f\u8fd9\u90e8\u5206\u5185\u5b58\u5982\u4f55\u8fdb\u884c\u56de\u6536\u3002<\/span><\/span><\/span><\/span><\/span><\/p>

\u5bf9\u8c61\u72b6\u6001\u5224\u65ad<\/span><\/span><\/span><\/span><\/span><\/strong><\/p>

\u3000\u3000<\/span><\/span><\/span><\/span><\/span><\/strong>\u5728\u7814\u7a76\u5bf9\u8c61\u7684\u56de\u6536\u4e4b\u524d\uff0c\u6211\u4eec\u9700\u8981\u5148\u770b\u4e00\u4e0b\u5982\u4f55\u8fdb\u884c\u5224\u65ad\u5bf9\u8c61\u662f\u5426\u8fd8\u6709\u5b58\u6d3b\u4ef7\u503c\uff0c\u5373\u8981\u5148\u5224\u65ad\u5bf9\u8c61\u662f\u5426\u8fd8\u6709\u88ab\u5f15\u7528\uff0c\u8fd9\u662f\u6211\u4eec\u8fdb\u884c\u5783\u573e\u56de\u6536\u7684\u7b2c\u4e00\u6b65\uff0c\u5224\u65ad\u5bf9\u8c61\u5b58\u6d3b\u72b6\u6001\u3002\u63a5\u4e0b\u6765\u6211\u4f1a\u8bb2\u4e00\u4e0b\u51e0\u79cd\u5224\u65ad\u7684\u65b9\u6cd5\u3002<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000 1.\u3001\u5f15\u7528\u8ba1\u6570\u6cd5<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000 \u4e00\u4e2a\u6bd4\u8f83\u901a\u4fd7\u7684\u65b9\u6cd5\u5c31\u662f\u5f53\u5bf9\u8c61\u5728\u521b\u5efa\u7684\u65f6\u5019\uff0c\u5c31\u7ed9\u5bf9\u8c61\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61\u8ba1\u6570\u5668\uff0c\u6bcf\u5f53\u6709\u4e00\u4e2a\u5730\u65b9\u5f15\u7528\u5230\u8fd9\u4e2a\u5bf9\u8c61\u7684\u65f6\u5019\uff0c\u8ba1\u6570\u5668\u52a0\u4e00\uff1b\u5f53\u5f15\u7528\u5931\u6548\u7684\u65f6\u5019\uff0c\u8ba1\u6570\u5668\u51cf1\uff1b\u4efb\u4f55\u65f6\u5019\u8ba1\u6570\u5668\u4e3a0\u7684\u5bf9\u8c61\u5c31\u662f\u4e0d\u53ef\u80fd\u88ab\u4f7f\u7528\u7684\uff0c\u5c31\u662f\u6211\u4eec\u6240\u8ba4\u77e5\u7684 --\u6b7b\u4ea1\u5bf9\u8c61\u3002 \u5ba2\u89c2\u5730\u8bf4\uff0c\u5f15\u7528\u8ba1\u6570\u7b97\u6cd5\u7684\u5b9e\u73b0\u6bd4\u8f83\u7b80\u5355\uff0c\u5224\u5b9a\u6548\u7387\u4e5f\u5f88\u9ad8\uff0c\u5728\u5927\u90e8\u5206\u60c5\u51b5\u4e0b\u5b83\u90fd\u662f\u4e00\u4e2a\u4e0d\u9519\u7684\u7b97\u6cd5\uff0c\u4e5f\u6709\u4e00\u4e9b\u6bd4\u8f83\u8457\u540d\u7684\u5e94\u7528\u6848\u4f8b\uff0c\u4f8b\u5982\u5fae\u8f6f\u516c\u53f8\u7684COM\uff08Component Obejct Mode\uff09\u6280\u672f\uff0c\u4f7f\u7528ActionScript3\u7684FlashPlayer\u7b49\u6280\u672f\u90fd\u5f15\u7528\u4e86\u6280\u672f\u7b97\u6cd5\u8fdb\u884c\u5185\u5b58\u7ba1\u7406\u3002 \u4f46\u662f\uff0c\u81f3\u5c11\u4e3b\u6d41\u7684Java\u865a\u62df\u673a\u91cc\u9762\u6ca1\u6709\u7528\u5230\u5f15\u7528\u8ba1\u6570\u7b97\u6cd5\u6765\u7ba1\u7406\u5185\u5b58\uff0c\u4e4b\u4e2d\u6700\u4e3b\u8981\u7684\u95ee\u9898\u5c31\u662f\u4ed6\u5f88\u96be\u89e3\u51b3\u5bf9\u8c61\u4e4b\u95f4\u76f8\u4e92\u5faa\u73af\u5f15\u7528\u7684\u95ee\u9898\uff1a<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u8fd9\u91cc\u9762\u5982\u679c\u91c7\u7528\u7684\u662f\u5f15\u7528\u8ba1\u6570\u7b97\u6cd5\u6765\u8fdb\u884c\u5783\u573e\u56de\u6536\u7684\u8bdd\uff0c\u8fd9\u79cd\u5bf9\u8c61\u660e\u660e\u662f\u6ca1\u6709\u4f7f\u7528\uff0c\u4f46\u662f\u5374\u4ecd\u7136\u5360\u5185\u5b58\uff0c\u5728Java\u4e2d\uff0c\u8fd9\u79cd\u60c5\u51b5\u662f\u975e\u5e38\u5e38\u89c1\u7684\uff0c\u6240\u4ee5\u8fd9\u79cd\u7b97\u6cd5\u5e76\u4e0d\u80fd\u89e3\u51b3Java\u4e2d\u5bf9\u8c61\u76f8\u4e92\u5f15\u7528\u7684\u95ee\u9898\uff0c\u6240\u4ee5Java\u865a\u62df\u673a\u5224\u65ad\u5bf9\u8c61\u5b58\u6d3b\u72b6\u6001\u7684\u7b97\u6cd5\u662f\u9009\u62e9\u4e86\u63a5\u4e0b\u6765\u4ecb\u7ecd\u7684--\u53ef\u8fbe\u6027\u5206\u6790\u7b97\u6cd5\u3002<\/span><\/p>

\u3000\u3000\u3000\u30002\u3001\u53ef\u8fbe\u6027\u5206\u6790\u7b97\u6cd5<\/span><\/p>

\u3000\u3000\u3000\u3000\u3000 \u3000\"\"<\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u8fd9\u4e2a\u7b97\u6cd5\u7684\u57fa\u672c\u601d\u60f3\u662f\uff0c\u901a\u8fc7\u4e00\u7cfb\u5217\u7684GC Roots \u7684\u5bf9\u8c61\u4f5c\u4e3a\u4e03\u70b9\uff0c\u4ece\u8fd9\u4e9b\u8282\u70b9\u5f00\u59cb\u7684\u5411\u4e0b\u641c\u7d22\uff0c\u641c\u7d22\u6240\u8d70\u8fc7\u7684\u8def\u5f84\u6210\u4e3a\u5f15\u7528\u8fde\uff0c\u5f53\u4e00\u4e2a\u5bf9\u8c61\u5230GC Roots \u6ca1\u6709\u4efb\u4f55\u5f15\u7528\u94fe\u76f8\u8fde\u65f6\uff0c\u5219\u8bc1\u660e\u6b64\u5bf9\u8c61\u65f6\u4e0d\u53ef\u7528\u7684\u3002 \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u867d\u7136Object5\uff0cObject6\u548cObject7\u76f8\u4e92\u6709\u5f15\u7528\uff0c\u4f46\u662f\u4ed6\u4eec\u4e0eGC Roots\u95f4\u662f\u4e0d\u53ef\u8fbe\u7684\uff0c\u6240\u4ee5\u5b83\u4eec\u5c06\u4f1a\u88ab\u5224\u5b9a\u4e3a\u4f7f\u53ef\u56de\u6536\u7684\u5bf9\u8c61\u3002<\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u5927\u5bb6\u53ef\u80fd\u4f1a\u5f88\u7591\u60d1\uff0c\u90a3\u4e3a\u4ec0\u4e48Object5\u4e3a\u4ec0\u4e48\u4e0d\u80fd\u5f53GC Roots\u5462\uff1f<\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u9996\u5148\uff0c\u6211\u4eec\u8981\u89c4\u5b9a\u597dGC Roots\u7684\u5b9a\u4e49\u8303\u56f4\uff0c\u5e76\u4e0d\u662f\u8bf4\u6240\u6709\u7684\u5bf9\u8c61\u90fd\u80fd\u591f\u6210\u4e3aGC Roots\uff1a<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u5728Java \u8bed\u8a00\u4e2d\uff0c\u53ef\u4f5c\u4e3aGC Roots \u7684\u5bf9\u8c61\u5305\u62ec\u4e0b\u9762\u51e0\u79cd\uff1a<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 - \u865a\u62df\u673a\u6808\uff08\u6808\u5e27\u4e2d\u7684\u672c\u5730\u53d8\u91cf\u8868\uff09\u5f15\u7528\u7684\u5bf9\u8c61<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 - \u65b9\u6cd5\u533a\u4e2d\u7c7b\u9759\u6001\u5c5e\u6027\u5f15\u7528\u7684\u5bf9\u8c61<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 - \u65b9\u6cd5\u533a\u4e2d\u5e38\u91cf\u5f15\u7528\u7684\u5bf9\u8c61<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000- \u672c\u5730\u65b9\u6cd5\u6808\u4e2dJNI\u5f15\u7528\u7684\u5bf9\u8c61<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u5bf9\u8c61\u5728\u88ab\u56de\u6536\u524d\u6700\u540e\u7684\u81ea\u6211\u6551\u8d4e<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/strong><\/span><\/p>

\u3000\u3000<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/strong><\/span><\/p>

\u3000\u3000\u3000\u3000<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/strong>\u4e0a\u9762\u6211\u4eec\u8bf4\u5b8c\u4e86Java\u865a\u62df\u673a\u4e2d\u5224\u65ad\u5bf9\u8c61\u5b58\u6d3b\u72b6\u6001\u7684\u7b97\u6cd5\uff0c\u90a3\u4e48\u662f\u4e0d\u662f\u8bf4\u6211\u4eec\u5224\u65ad\u51fa\u5bf9\u8c61\u65f6\u6ca1\u6709\uff08\u6709\u6548\uff09\u5f15\u7528\u4e4b\u540e\u5c31\u4f1a\u88ab\u9a6c\u4e0a\u56de\u6536\u5462\uff1f\u5b9e\u9645\u4e0a\u5e76\u4e0d\u662f\u8fd9\u6837\u7684\uff0c\u5373\u65f6\u5728\u53ef\u8fbe\u6027\u5206\u6790\u5206\u7b97\u6cd5\u4e2d\u4e0d\u53ef\u8fbe\u7684\u5bf9\u8c61\uff0c\u4e5f\u5e76\u975e\u662f\u201c\u975e\u6b7b\u4e0d\u53ef\u201d\u7684\uff0c\u8fd9\u65f6\u5019\u5b83\u4eec\u6682\u65f6\u5904\u4e8e\u201c\u7f13\u5211\u201d\u9636\u6bb5\u3002<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u5bf9\u8c61\u8981\u88ab\u5ba3\u544a\u6b7b\u4ea1\u8981\u7ecf\u5386\u4e24\u4e2a\u9636\u6bb5\uff1a<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u7b2c\u4e00\u4e2a\u9636\u6bb5\u5c31\u662f\u53ef\u8fbe\u6027\u5206\u6790\uff0c\u5224\u65ad\u5bf9\u8c61\u662f\u5426\u5177\u6709\u6709\u6548\u5f15\u7528<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000 \u7b2c\u4e8c\u4e2a\u9636\u6bb5\u5c31\u662f\u5224\u65ad\u5bf9\u8c61\u662f\u5426\u6709\u5fc5\u8981\u6267\u884c finalize\uff08\uff09\u65b9\u6cd5\u3002\u5f53\u5bf9\u8c61\u6ca1\u6709\u8986\u76d6finalize\uff08\uff09\u65b9\u6cd5\u6216\u8005finalize\uff08\uff09\u65b9\u6cd5\u5df2\u7ecf\u88ab\u865a\u62df\u673a\u8c03\u7528\u8fc7\uff0c\u865a\u62df\u673a\u5c06\u8fd9\u4e24\u79cd\u60c5\u51b5\u79f0\u4e3a\u201c\u6ca1\u6709\u5fc5\u8981\u6267\u884c\u201d\uff0c\u5c31\u662f\u5bf9\u8c61\u5df2\u7ecf\u6ca1\u6709\u4efb\u4f55\u673a\u4f1a\u5b8c\u6210\u6551\u8d4e\u3002<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u8f93\u51fa\u7ed3\u679c\uff1a<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u6211\u4eec\u53ef\u4ee5\u770b\u5230\uff0c\u5728\u5bf9\u8c61\u201c\u6b7b\u4ea1\u201d\u4e4b\u540e\uff0c\u5e76\u6ca1\u6709\u9a6c\u4e0a\u6b7b\u4ea1\uff0c\u6211\u4eec\u8986\u76d6\u4e86\u7236\u7c7b\u7684finalized \u65b9\u6cd5\uff0c\u8fd9\u65f6\u5019\u5c31\u4f1a\u7ed9\u5bf9\u8c61\u4e00\u6b21\u6551\u8d4e\u7684\u673a\u4f1a\uff0c\u4f46\u662f\u4e5f\u5c31\u4ec5\u6b64\u4e00\u6b21\uff0c\u5f53\u5bf9\u8c61\u7b2c\u4e8c\u6b21\u201c\u6b7b\u4ea1\u201d\u7684\u65f6\u5019\uff0c\u6211\u4eec\u53d1\u73b0\uff0c\u5373\u4f7f\u662f\u8986\u76d6\u4e86finalized\u65b9\u6cd5\u4e5f\u6ca1\u6709\u529e\u6cd5\u518d\u53bb\u62ef\u6551\u8fd9\u4e2a\u5bf9\u8c61\u4e86\u3002<\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u4ece\u4e0a\u9762\u7684\u4f8b\u5b50\u6211\u4eec\u53ef\u4ee5\u5f88\u76f4\u767d\u7684\u7406\u89e3\u8fd9\u4e2afinalized\u65b9\u6cd5\u5728\u5783\u573e\u56de\u6536\u4e2d\u8d77\u5230\u7684\u4f5c\u7528\uff0c\u90a3\u5c31\u662f\u4e00\u6b21\u4e14\u4ec5\u4e00\u6b21\u6551\u8d4e\u7684\u673a\u4f1a\u3002<\/p>

\u65b9\u6cd5\u533a\u7684\u56de\u6536<\/span><\/strong><\/p>

\u3000\u3000\u3000<\/span><\/strong>\u5b9e\u9645\u4e0a\u65b9\u6cd5\u533a\u8fd8\u662f\u4f1a\u8fdb\u884c\u5783\u573e\u56de\u6536\uff0c\u4f46\u662f\u6548\u7387\u8fdc\u8fdc\u6bd4\u4e0d\u4e0a\u5806\u4e2d\u5783\u573e\u7684\u56de\u6536\uff0c\u56e0\u6b64\u5728\u5783\u573e\u56de\u6536\u4e2d\u7ecf\u5e38\u4f1a\u88ab\u5ffd\u7565\u6389\u3002\u65b9\u6cd5\u533a\u4e2d\uff0c\u5783\u573e\u6536\u96c6\u7684\u4e3b\u8981\u5185\u5bb9\u5206\u4e3a\u4e24\u90e8\u5206\uff1a\u5e9f\u5f03\u5e38\u91cf\u548c\u65e0\u7528\u7684\u7c7b<\/span><\/p>

\u3000\u3000\u3000\u3000 1. \u5e9f\u5f03\u5e38\u91cf<\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u8fd9\u90e8\u5206\u6211\u4eec\u4f1a\u6bd4\u8f83\u5bb9\u6613\u7406\u89e3\uff0c\u5c31\u4e3e\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff0cString str= \"abc\";\u8fd9\u65f6\u5019abc\u5c31\u5df2\u7ecf\u8fdb\u5165\u4e86\u5e38\u91cf\u6c60\u4e2d\uff0c\u5f53str\u6539\u53d8\u7c7b\u503c\uff0c\u90a3\u4e48\u4e45\u6ca1\u6709\u5bf9\u8c61\u5f15\u7528\"abc\"\u8fd9\u4e2a\u5e38\u91cf\uff0c\u8fd9\u65f6\u5019\uff0c\"abc\"\u5c31\u4f1a\u88ab\u7cfb\u7edf\u6e05\u7406\u51fa\u5e38\u91cf\u6c60\u3002\u5e38\u91cf\u6c60\u4e2d\u7684\u5176\u4ed6\u7c7b\u3001\u65b9\u6cd5\u3001\u5b57\u6bb5\u7684\u7b26\u53f7\u5f15\u7528\u4e5f\u662f\u5982\u6b64<\/span><\/p>

\u3000\u3000\u3000\u3000<\/span><\/p>

\u3000\u3000\u3000\u30002. \u65e0\u7528\u7684\u7c7b<\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u5224\u5b9a\u4e00\u4e2a\u7c7b\u662f\u5426\u662f\u65e0\u7528\u7684\u7c7b\u7684\u6761\u4ef6\u76f8\u5bf9\u82db\u523b\u8bb8\u591a\u3002\u7c7b\u9700\u8981\u540c\u65f6\u6ee1\u8db3\u4ee5\u4e0b\u4e09\u4e2a\u6761\u4ef6\u624d\u80fd\u7b97\u662f\u201c\u65e0\u7528\u7684\u7c7b\u201d<\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30001\u3002\u8be5\u7c7b\u6240\u6709\u7684\u5b9e\u4f8b\u90fd\u5df2\u7ecf\u88ab\u56de\u6536\uff0c\u4e5f\u5c31\u662fJava\u5806\u4e2d\u5df2\u7ecf\u4e0d\u5b58\u5728\u8be5\u7c7b\u7684\u4efb\u4f55\u5b9e\u4f8b<\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30002\u3002\u52a0\u8f7d\u8be5\u7c7b\u7684ClassLoader\u5df2\u7ecf\u88ab\u56de\u6536<\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u30003\u3002\u8be5\u7c7b\u5bf9\u8c61\u7684Java.lang.Class \u5bf9\u8c61\u6ca1\u6709\u5728\u4efb\u4f55\u5730\u65b9\u5457\u5f15\u7528\uff0c\u65e0\u6cd5\u518d\u4efb\u4f55\u5730\u65b9\u901a\u8fc7\u53cd\u5c04\u8bbf\u95ee\u8be5\u7c7b<\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000 \u865a\u62df\u673a\u53ef\u4ee5\u5bf9\u6ee1\u8db3\u4e0a\u8ff03\u4e2a\u6761\u4ef6\u7684\u65e0\u7528\u7c7b\u5bf9\u8c61\u8fdb\u884c\u56de\u6536\uff0c\u8fd9\u91cc\u8bf4\u7684\u4ec5\u4ec5\u662f\u201c\u53ef\u4ee5\u201d\uff0c\u884c\u4e0d\u662f\u548c\u5bf9\u8c61\u4e00\u6837\uff0c\u4e0d\u9002\u7528\u5c31\u5fc5\u7136\u56de\u6536\u3002<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000\u3000\u9700\u8981\u5bf9HotSpot\u865a\u62df\u673a\u7684\u53c2\u6570\u8fdb\u884c\u8bbe\u7f6e\uff0c\u63a7\u5236\u56de\u6536\u3002<\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>

\u3000\u3000\u3000\u3000\u3000\u3000 \u4e00\u822c\u60c5\u51b5\u4e0b\u6211\u4eec\u4e0d\u4f1a\u5bf9\u65b9\u6cd5\u533a\u7684\u65e0\u7528\u7c7b\u8fdb\u884c\u56de\u6536\uff0c\u4f46\u662f\u5728\u5927\u91cf\u4f7f\u7528\u53cd\u5c04\uff0c\u52a8\u6001\u4ee3\u7406\u3001CGLib\u7b49ByteCode\u6846\u67b6\u3001\u8fd9\u7c7b\u9891\u7e41\u81ea\u5b9a\u4e49ClassLoader\u7684\u573a\u666f\u90fd\u9700\u8981\u865a\u62df\u673a\u5177\u5907\u7c7b\u5378\u8f7d\u7684\u529f\u80fd\uff0c\u4ee5\u4fdd\u8bc1\u6c38\u4e45\u4ee3\u4e0d\u4f1a\u6ea2\u51fa\u3002 <\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/span><\/p>","orderid":"0","title":"\u6df1\u5165Java\u865a\u62df\u673a--\u5224\u65ad\u5bf9\u8c61\u5b58\u6d3b\u72b6\u6001","smalltitle":"","mid":"0","fname":"linux\u7f16\u7a0b\u57fa\u7840","special_id":"0","bak_id":"0","info":"0","hits":"33","pages":"1","comments":"0","posttime":"2017-01-02 08:15:18","list":"1483316118","username":"admin","author":"","copyfrom":"","copyfromurl":"","titlecolor":"","fonttype":"0","titleicon":"0","picurl":"http:\/\/www.cppentry.com\/upload_files\/","ispic":"0","yz":"1","yzer":"","yztime":"0","levels":"0","levelstime":"0","keywords":"\u6df1\u5165<\/A> Java<\/A> \u865a\u62df<\/A> \u5224\u65ad<\/A> \u5bf9\u8c61<\/A> \u5b58\u6d3b<\/A> \u72b6\u6001<\/A>","jumpurl":"","iframeurl":"","style":"","template":"a:3:{s:4:\"head\";s:0:\"\";s:4:\"foot\";s:0:\"\";s:8:\"bencandy\";s:0:\"\";}","target":"0","ip":"14.17.22.31","lastfid":"0","money":"0","buyuser":"","passwd":"","allowdown":"","allowview":"","editer":"","edittime":"0","begintime":"0","endtime":"0","description":"\u6df1\u5165Java\u865a\u62df\u673a--\u5224\u65ad\u5bf9\u8c61\u5b58\u6d3b\u72b6\u6001","lastview":"1484877857","digg_num":"0","digg_time":"0","forbidcomment":"0","ifvote":"0","heart":"","htmlname":"","city_id":"0"},"page":"1"}