锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲国产精品日韩,亚洲av日韩av永久无码电影,国产精品亚洲va在线观看http://www.tkk7.com/lichen6928/zh-cnSat, 10 May 2025 10:56:39 GMTSat, 10 May 2025 10:56:39 GMT60java涓瑿lass綾誨瀷錛堬紤錛?/title><link>http://www.tkk7.com/lichen6928/archive/2011/03/13/346154.html</link><dc:creator>灝忔櫀</dc:creator><author>灝忔櫀</author><pubDate>Sun, 13 Mar 2011 10:41:00 GMT</pubDate><guid>http://www.tkk7.com/lichen6928/archive/2011/03/13/346154.html</guid><wfw:comment>http://www.tkk7.com/lichen6928/comments/346154.html</wfw:comment><comments>http://www.tkk7.com/lichen6928/archive/2011/03/13/346154.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.tkk7.com/lichen6928/comments/commentRss/346154.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/lichen6928/services/trackbacks/346154.html</trackback:ping><description><![CDATA[<h4 align="left"> </h4> <p>鍦╦ava紼嬪簭涓瘡涓涓被閮芥湁涓涓狢lass瀵硅薄錛岃淇濆瓨鍦ㄥ悓鍚嶇殑.Class瀵硅薄褰撲腑錛孞VM浼氫嬌鐢ㄧ被鍔犺澆鍣ㄥ姞杞紺lass鏂囦歡鐢熸垚綾葷殑瀵硅薄淇℃伅錛?/p> <p>褰撴垜浠垱寤轟竴涓被鐨勫璞℃垨鑰呰皟鐢ㄨ繖涓璞$殑闈欐佹柟娉?jvm浼氳嚜鍔ㄥ姞杞界被鐨勫璞′俊鎭?/p> <h4>鑾峰緱綾葷殑瀵硅薄淇℃伅</h4> <p>鎴戜滑涓鑸父鐢ㄧ敤涓ょ鏂瑰紡鑾峰緱綾葷殑瀵硅薄淇℃伅錛?/p> <p>1. 鎴戜滑鍙互鐢–lass.forName()鏂規硶鍔ㄦ佺殑鏍規嵁綾誨悕鑾峰緱涓涓被鐨凜lass瀵硅薄錛?/p> <pre style="border: 1px solid #c0c0c0; padding: 5px; background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto;"> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 1: <span style="color: #008000;">/**<br /> </span></pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 2: * 浣跨敤姝ゆ柟娉曚負鑷姩鍒濆鍖栭潤鎬佸彉閲忓拰鎵цstatic鍧楃殑浠g爜<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 3: * 濡傛灉鎵句笉鍒板璞′細鎶涘嚭涓涓狢lassNotFoundException<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 4: */<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 5: Class second = Class.forName("<span style="color: #8b0000;">classLoad.Second</span>");</pre> </pre> <p>2. 鎴戜滑榪樺彲浠ョ敤Class class = ClassName.class 鏉ョ洿鎺ヨ幏鍙栦竴涓被鐨勭被鍨嬩俊鎭?浣嗙敤瀹冨拰Class.forName()鑾峰彇綾葷殑瀵硅薄</p> <p>寮曠敤淇℃伅鍦ㄩ潤鎬佸潡鏃剁殑鎵ц鏃墮棿涓婁笉鍚岋紝鐪嬩笅闈㈢殑渚嬪瓙錛?/p> <p>涓涓櫘閫氱被淇℃伅</p> <pre style="border: 1px solid #c0c0c0; padding: 5px; background-color: #f0f0f0; min-height: 40px; width: 705px; height: 540px; overflow: auto;"> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 1: <span style="color: #0000ff;">interface</span> Interface{<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 2: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> String interFlag = "<span style="color: #8b0000;">鎺ュ彛</span>";<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 3: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 4: }<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 5: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 6: <span style="color: #0000ff;">class</span> Parent <span style="color: #0000ff;">implements</span> Interface{<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 7: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> String parntFLAG = "<span style="color: #8b0000;">鐖剁被闈欐佸彉閲?/span>";<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 8: <span style="color: #0000ff;">static</span>{<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 9: <span style="color: #0000ff;">final</span> String flag2 = "<span style="color: #8b0000;">flag2</span>";<span style="color: #008000;">//static 鍖轟腑鍙兘鐢╢inal淇グ</span><br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 10: System.out.println("<span style="color: #8b0000;">鎴戝湪鐖剁被闈欐佸尯閲岄潰錛?/span>"+parntFLAG);<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 11: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 12: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 13: <span style="color: #0000ff;">public</span> Parent(){<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 14: System.out.println("<span style="color: #8b0000;">鎴戝湪鐖剁被鏋勯犲嚱鏁伴噷闈紒</span>");<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 15: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 16: }<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 17: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 18: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 19: <span style="color: #0000ff;">class</span> Son <span style="color: #0000ff;">extends</span> Parent{<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 20: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> String sonFLAG = "<span style="color: #8b0000;">瀛愮被綾婚潤鎬佸彉閲?/span>";<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 21: <span style="color: #0000ff;">static</span>{<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 22: System.out.println("<span style="color: #8b0000;">鎴戝湪瀛愮被闈欐佸尯閲岄潰錛?/span>"+sonFLAG);<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 23: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 24: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 25: <span style="color: #0000ff;">public</span> Son(){<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 26: System.out.println("<span style="color: #8b0000;">鎴戝湪瀛愮被鏋勯犲嚱鏁伴噷闈紒</span>");<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 27: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 28: }</pre> </pre> <pre style="border: 1px solid #c0c0c0; padding: 5px; background-color: #f0f0f0; min-height: 40px; width: 705px; height: 519px; overflow: auto;"> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 1: <span style="color: #0000ff;">interface</span> Interface{<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 2: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> String interFlag = "<span style="color: #8b0000;">鎺ュ彛</span>";<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 3: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 4: }<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 5: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 6: <span style="color: #0000ff;">class</span> Parent <span style="color: #0000ff;">implements</span> Interface{<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 7: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> String parntFLAG = "<span style="color: #8b0000;">鐖剁被闈欐佸彉閲?/span>";<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 8: <span style="color: #0000ff;">static</span>{<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 9: <span style="color: #0000ff;">final</span> String flag2 = "<span style="color: #8b0000;">flag2</span>";<span style="color: #008000;">//static 鍖轟腑鍙兘鐢╢inal淇グ</span><br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 10: System.out.println("<span style="color: #8b0000;">鎴戝湪鐖剁被闈欐佸尯閲岄潰錛?/span>"+parntFLAG);<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 11: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 12: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 13: <span style="color: #0000ff;">public</span> Parent(){<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 14: System.out.println("<span style="color: #8b0000;">鎴戝湪鐖剁被鏋勯犲嚱鏁伴噷闈紒</span>");<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 15: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 16: }<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 17: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 18: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 19: <span style="color: #0000ff;">class</span> Son <span style="color: #0000ff;">extends</span> Parent{<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 20: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> String sonFLAG = "<span style="color: #8b0000;">瀛愮被綾婚潤鎬佸彉閲?/span>";<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 21: <span style="color: #0000ff;">static</span>{<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 22: System.out.println("<span style="color: #8b0000;">鎴戝湪瀛愮被闈欐佸尯閲岄潰錛?/span>"+sonFLAG);<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 23: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 24: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 25: <span style="color: #0000ff;">public</span> Son(){<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 26: System.out.println("<span style="color: #8b0000;">鎴戝湪瀛愮被鏋勯犲嚱鏁伴噷闈紒</span>");<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 27: }<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 28: }</pre> </pre> <p>浣跨敤榪欑鏂規硶寮曠敤綾葷殑瀵硅薄涓嶄細濮嬪寲闈欐佸彉閲忓拰鎵ц闈欐佸潡淇℃伅錛岃繖浜涗唬鐮佹柟娉曚細鍦ㄩ嬈″紩鐢ㄦ椂鎵ц錛?/p> <p>濡備笅寮曠敤鐖剁被鐨勯潤鎬佸彉閲忥紝涓嶄細鎵ц瀛愮被鐨勯潤鎬佸潡錛?/p> <pre style="border: 1px solid #c0c0c0; padding: 5px; background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto;"> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 1: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> ClassLoad {<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 2: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> main(String[] args) <span style="color: #0000ff;">throws</span> ClassNotFoundException {<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 3: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 4: <span style="color: #008000;">//Son son = new Son();</span><br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 5: <span style="color: #008000;">/**<br /> </span></pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 6: * 鎴戜滑浣跨敤涓涓被鐨勬椂鍊欓渶瑕佽繘琛屼互涓嬶紦欏瑰伐浣滐紟<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 7: * 1.鍔犺澆錛?br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 8: * 2.閾炬帴<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 9: * 3.鍒濆鍖栵紝姝ゆ浼氬垵濮嬪寲闈欐佸彉閲忓拰鎵ц闈欐佸潡淇℃伅錛屼絾鏄繖縐嶆柟娉曚細鍦?br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 10: * 鐪熸璋冪敤鏂規硶鏃舵墽琛?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 11: */<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 12: Class son = Son.<span style="color: #0000ff;">class</span>;<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 13: System.out.println("<span style="color: #8b0000;">闈欐佸尯鐨勫垵濮嬪寲浼氬湪璋冪敤鏃舵墽琛岋紒</span>");<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 14: <span style="color: #008000;">// parntFLAG 鏄埗綾葷殑闈欐佸彉閲忋</span><br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 15: <span style="color: #008000;">// 姝ゅ鍙細鎵ц鐖剁被鐨勯潤鎬佸揩</span><br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 16: System.out.println(Son.<font color="#ff0000">parntFLAG</font>);<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 17: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 18: <span style="color: #008000;">/**<br /> </span></pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 19: * 榪愯緇撴灉<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 20: *闈欐佸尯鐨勫垵濮嬪寲浼氬湪璋冪敤鏃舵墽琛岋紒<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 21: *鎴戝湪鐖剁被闈欐佸尯閲岄潰錛佺埗綾婚潤鎬佸彉閲?br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 22: *鐖剁被闈欐佸彉閲?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 23: */<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 24: }<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 25: }</pre> </pre> <blockquote></blockquote> <p>鎵撳嵃瀛愮被鐨勯潤鎬佸彉閲忥紝鎵鏈夌殑浠g爜閮戒細鎵ц</p> <pre style="border: 1px solid #c0c0c0; padding: 5px; background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto;"> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 1: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 2: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> ClassLoad {<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 3: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> main(String[] args) <span style="color: #0000ff;">throws</span> ClassNotFoundException {<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 4: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 5: <span style="color: #008000;">//Son son = new Son();</span><br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 6: <span style="color: #008000;">/**<br /> </span></pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 7: * 鎴戜滑浣跨敤涓涓被鐨勬椂鍊欓渶瑕佽繘琛屼互涓嬶紦欏瑰伐浣滐紟<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 8: * 1.鍔犺澆錛?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 9: * 2.閾炬帴<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 10: * 3.鍒濆鍖栵紝姝ゆ浼氬垵濮嬪寲闈欐佸彉閲忓拰鎵ц闈欐佸潡淇℃伅錛屼絾鏄繖縐嶆柟娉曚細鍦?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 11: * 鐪熸璋冪敤鏂規硶鏃舵墽琛?br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 12: */<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 13: Class son = Son.<span style="color: #0000ff;">class</span>;<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 14: System.out.println("<span style="color: #8b0000;">闈欐佸尯鐨勫垵濮嬪寲浼氬湪璋冪敤鏃舵墽琛岋紒</span>");<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 15: <span style="color: #008000;">// parntFLAG 鏄埗綾葷殑闈欐佸彉閲忋</span><br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 16: <span style="color: #008000;">// 姝ゅ鍙細鎵ц鐖剁被鐨勯潤鎬佸揩</span><br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 17: System.out.println(Son.<font color="#ff0000">sonFLAG</font>);<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 18: <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 19: <span style="color: #008000;">/**<br /> </span></pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 20: * 榪愯緇撴灉<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 21: * 闈欐佸尯鐨勫垵濮嬪寲浼氬湪璋冪敤鏃舵墽琛岋紒<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 22: * 鎴戝湪鐖剁被闈欐佸尯閲岄潰錛佺埗綾婚潤鎬佸彉閲?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 23: * 鎴戝湪瀛愮被闈欐佸尯閲岄潰錛佸瓙綾葷被闈欐佸彉閲?br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 24: * 瀛愮被綾婚潤鎬佸彉閲?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 25: */<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 26: }<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 27: }</pre> </pre> <p> </p> <p>浣嗘槸浣跨敤Class.forName 綾誨姞杞芥椂灝變細瀹屾垚鍒濆鍖栧伐浣滐紟</p> <pre style="border: 1px solid #c0c0c0; padding: 5px; background-color: #f0f0f0; min-height: 40px; width: 650px; overflow: auto;"> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 1: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> ClassLoad {<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 2: <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">static</span> <span style="color: #0000ff;">void</span> main(String[] args) <span style="color: #0000ff;">throws</span> Exception {<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 3: <span style="color: #008000;">/**<br /> </span></pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 4: * 浣跨敤Class.forName浼氳嚜鍔ㄥ姞杞芥墍鏈夐潤鎬佸尯鐨勪俊鎭?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 5: */<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 6: Class son = Class.forName("<span style="color: #8b0000;">classLoad.Son</span>");<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 7: Son instance = (Son)son.newInstance();<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 8: <span style="color: #008000;">/*<br /> </span></pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 9: * 鎵ц緇撴灉<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 10: * 鎴戝湪鐖剁被闈欐佸尯閲岄潰錛佺埗綾婚潤鎬佸彉閲?br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 11: * 鎴戝湪瀛愮被闈欐佸尯閲岄潰錛佸瓙綾葷被闈欐佸彉閲?br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 12: * 鎴戝湪鐖剁被鏋勯犲嚱鏁伴噷闈紒<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 13: * 鎴戝湪瀛愮被鏋勯犲嚱鏁伴噷闈紒<br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 14: */ <br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 15: <br /> </pre> <pre style="background-color: #e1e1e1; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 16: }<br /> </pre> <pre style="background-color: #fbfbfb; margin: 0em; width: 100%; font-family: consolas,'Courier New',courier,monospace; font-size: 12px;"> 17: }</pre> </pre> <img src ="http://www.tkk7.com/lichen6928/aggbug/346154.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/lichen6928/" target="_blank">灝忔櫀</a> 2011-03-13 18:41 <a href="http://www.tkk7.com/lichen6928/archive/2011/03/13/346154.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>ThreadLocalhttp://www.tkk7.com/lichen6928/archive/2009/05/14/270702.html灝忔櫀灝忔櫀Thu, 14 May 2009 13:03:00 GMThttp://www.tkk7.com/lichen6928/archive/2009/05/14/270702.htmlhttp://www.tkk7.com/lichen6928/comments/270702.htmlhttp://www.tkk7.com/lichen6928/archive/2009/05/14/270702.html#Feedback0http://www.tkk7.com/lichen6928/comments/commentRss/270702.htmlhttp://www.tkk7.com/lichen6928/services/trackbacks/270702.html璇ョ被鎻愪緵浜嗙嚎紼嬪眬閮?(thread-local) 鍙橀噺銆傝繖浜涘彉閲忎笉鍚屼簬瀹冧滑鐨勬櫘閫氬搴旂墿錛屽洜涓鴻闂煇涓彉閲忥紙閫氳繃鍏?get 鎴?set 鏂規硶錛夌殑姣忎釜綰跨▼閮芥湁鑷繁鐨勫眬閮ㄥ彉閲忥紝瀹冪嫭绔嬩簬鍙橀噺鐨勫垵濮嬪寲鍓湰銆俆hreadLocal 瀹炰緥閫氬父鏄被涓殑 private static 瀛楁錛屽畠浠笇鏈涘皢鐘舵佷笌鏌愪竴涓嚎紼嬶紙渚嬪錛岀敤鎴?ID 鎴栦簨鍔?ID錛夌浉鍏寵仈銆?

榪欎釜鏄粈涔堬紝灝辨槸瑙e喅涓涓嚎紼嬪唴鍏變韓涓涓彉閲忥紝榪欎釜鍙橀噺鍙湪榪欎釜綰跨▼鍐呴儴鏈夋晥錛屽湪涓涓嚎紼嬪唴璁塊棶鐨勯兘涓涓悓涓涓璞★紝鑰屽涓嚎紼嬩箣闂寸殑榪欎釜瀵硅薄鍗存槸鐩鎬簰鐙珛鐨勩傝鏉ュ氨鏄瘡涓涓嚎紼嬮兘鏈変竴涓嫭绔嬬殑姝ょ嚎紼嬪壇鏈?br>浣跨敤ThreadLocal涓鑸兘澹版槑涓洪潤鎬佺殑鍙橀噺
鍦ㄦ垜浠殑綰跨▼涓湁涓涓猼hreadLocals鐨凥ash琛ㄦ潵瀛樻斁榪欎釜瀵硅薄錛屾垜浠敤ThreadLocal瀵硅薄浣滀負涓婚敭錛屽洜姝ゆ垜浠殑ThreadLocal瀵硅薄澹版槑涓洪潤鎬佺殑

鎴戜滑鍙互浣跨敤澶氫釜TheadLocal錛屾潵浣夸竴涓嚎紼嬮噷鏈夊涓叡浜殑鍙橀噺
榪欎釜灝辨槸瑕佸疄鐜頒竴涓嚎紼嬮噷闈㈠叡浜竴涓彉閲?pre>public void set(Object value) { Thread t = Thread.currentThread(); ThreadLocalMap map = getMap(t); if (map != null) map.set(this, value); else createMap(t, value); }

 

    ThreadLocalMap getMap(Thread t) {
        return t.threadLocals;
    }


灝忔櫀 2009-05-14 21:03 鍙戣〃璇勮
]]>
淇敼IE涓殑HTTP璇鋒眰鏃墮棿http://www.tkk7.com/lichen6928/archive/2009/05/14/270699.html灝忔櫀灝忔櫀Thu, 14 May 2009 12:56:00 GMThttp://www.tkk7.com/lichen6928/archive/2009/05/14/270699.htmlhttp://www.tkk7.com/lichen6928/comments/270699.htmlhttp://www.tkk7.com/lichen6928/archive/2009/05/14/270699.html#Feedback0http://www.tkk7.com/lichen6928/comments/commentRss/270699.htmlhttp://www.tkk7.com/lichen6928/services/trackbacks/270699.html 

1. 娣誨姞甯︽湁鏁版嵁鍊?(< 嬈℃暟縐?>) ReceiveTimeout DWORD 鍊?*錛?鍦ㄤ互涓嬫敞鍐岃〃欏逛腑

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings
渚嬪, 濡傛灉甯屾湜瓚呮椂鏈熼棿灝?8 鍒嗛挓, ReceiveTimeout 鏁版嵁鍊艱緗負 480000 (< 480 > 1000錛?銆?

 
2. 閲嶆柊鍚姩璁$畻鏈恒?br>璇︽儏



灝忔櫀 2009-05-14 20:56 鍙戣〃璇勮
]]>
pb 璋冪敤dll鏂囦歡http://www.tkk7.com/lichen6928/archive/2009/05/14/270697.html灝忔櫀灝忔櫀Thu, 14 May 2009 12:48:00 GMThttp://www.tkk7.com/lichen6928/archive/2009/05/14/270697.htmlhttp://www.tkk7.com/lichen6928/comments/270697.htmlhttp://www.tkk7.com/lichen6928/archive/2009/05/14/270697.html#Feedback0http://www.tkk7.com/lichen6928/comments/commentRss/270697.htmlhttp://www.tkk7.com/lichen6928/services/trackbacks/270697.htmlLiveJournal Tags:

MICROSOFT         PB(16Bit)         PB(32Bit)

Bool                    Boolean         Boolean

Char*                 Ref string       Ref String

Colorref               Uint             Ulong

Dword                 Uint             Ulong

Handle                Uint             Ulong

Hdc                    Uint             Ulong

Hfile                   Uint             Ulong

Hinstance           Uint             Ulong

Hwnd                 Uint             Ulong

Int                     Int             Int

Lparam               Uint             Ulong

Lpbyte               Ref Int         Ref Long

Lpdword             Ref Uint        Ref Ulong

Lpfiletime           Ref Time        Ref Time

Lpint                 Ref Int          Ref Long

Lpstr,Lpststr       Ref String     Ref String

Lpvoid               Ref Structstruct_inst         Ref Struct struct_inst

Mcierror            Long             Long

Lpstr,Lpststr       Ref String     Ref String

Lpvoid              Ref Structstruct_inst         Ref Struct struct_inst

Pbyte               Ref Int[#]     Ref Long[#]

Short               Int         Int

Structure         Ref Struct struct_inst       Ref Struct Struct_inst

Uint                Uint              Uint

Void**           SUBROUTINE    SUBROUTINE

Word                         Int       Ulong

 

LiveJournal Tags:

 

Catch0 

pb鑳戒嬌鐢ㄧ殑蹇呴』鏄爣鍑唚inapi鍗硃asical 鍘嬫爤欏哄簭

  1. 鍒朵綔dll鏂囦歡鏃?闇瑕乻tdcal
  2. 鍦ㄥ嚱鏁頒腑鍔犲叆winapi

eg錛?/p>

DLLIMPORT WINAPI int CI_MACForPb(
              long           nFunction,      
              unsigned char  *pEntity,     
              unsigned char  *pInData,
              unsigned long  nInLength,
              unsigned char  *pMAC,
              unsigned long  *pnMACLength
              )


灝忔櫀 2009-05-14 20:48 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 久久夜色精品国产亚洲AV动态图| 国产av无码专区亚洲国产精品| 午夜亚洲AV日韩AV无码大全| 三年片在线观看免费西瓜视频| 亚洲日产无码中文字幕| a毛片在线免费观看| 亚洲中文字幕无码久久综合网| aa午夜免费剧场| 亚洲精品国精品久久99热一| 青柠影视在线观看免费高清| 久久亚洲精品AB无码播放| 无码AV片在线观看免费| 亚洲午夜久久久久久尤物| 免费精品国产自产拍在| 亚洲国产av玩弄放荡人妇| 免费看国产一级特黄aa大片| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 2021国内精品久久久久精免费| 亚洲高清视频在线播放| 99精品全国免费观看视频| 国产成人综合久久精品亚洲| 亚洲午夜爱爱香蕉片| 无码免费一区二区三区免费播放| 亚洲激情视频网站| 青青草国产免费久久久91| 久久www免费人成看国产片| 亚洲一区综合在线播放| 妞干网手机免费视频| www成人免费观看网站| 亚洲伦另类中文字幕| 精品国产免费观看| 最近更新免费中文字幕大全| 亚洲精品网站在线观看你懂的| 好大好硬好爽免费视频| 久久国产精品免费一区二区三区| 亚洲综合精品一二三区在线| 四虎影视在线永久免费看黄| 日本卡1卡2卡三卡免费| 亚洲AV日韩综合一区| 亚洲国产一区在线| 国产免费看插插插视频|