ï»??xml version="1.0" encoding="utf-8" standalone="yes"?>久久青青视频,日韩精品久久久,欧美午夜宅男影院http://www.aygfsteel.com/galaxyly/category/19245.htmlMy javaWorldzh-cnSun, 15 Apr 2007 03:40:50 GMTSun, 15 Apr 2007 03:40:50 GMT60JAVA3D包功能介¾l?/title><link>http://www.aygfsteel.com/galaxyly/archive/2007/04/15/110752.html</link><dc:creator>é“¶æ²³‹¹ïL›—</dc:creator><author>é“¶æ²³‹¹ïL›—</author><pubDate>Sun, 15 Apr 2007 03:06:00 GMT</pubDate><guid>http://www.aygfsteel.com/galaxyly/archive/2007/04/15/110752.html</guid><wfw:comment>http://www.aygfsteel.com/galaxyly/comments/110752.html</wfw:comment><comments>http://www.aygfsteel.com/galaxyly/archive/2007/04/15/110752.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/galaxyly/comments/commentRss/110752.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/galaxyly/services/trackbacks/110752.html</trackback:ping><description><![CDATA[     摘要: åŒ? ½Ž€ä»?          ...  <a href='http://www.aygfsteel.com/galaxyly/archive/2007/04/15/110752.html'>阅读全文</a><img src ="http://www.aygfsteel.com/galaxyly/aggbug/110752.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/galaxyly/" target="_blank">é“¶æ²³‹¹ïL›—</a> 2007-04-15 11:06 <a href="http://www.aygfsteel.com/galaxyly/archive/2007/04/15/110752.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>向上转型中子¾cÕd°†èƒ½çœ‹åˆ°çˆ¶¾c»è¢«è¦†ç›–字段的现象探è®?/title><link>http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107614.html</link><dc:creator>é“¶æ²³‹¹ïL›—</dc:creator><author>é“¶æ²³‹¹ïL›—</author><pubDate>Sat, 31 Mar 2007 03:31:00 GMT</pubDate><guid>http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107614.html</guid><wfw:comment>http://www.aygfsteel.com/galaxyly/comments/107614.html</wfw:comment><comments>http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107614.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.aygfsteel.com/galaxyly/comments/commentRss/107614.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/galaxyly/services/trackbacks/107614.html</trackback:ping><description><![CDATA[ <p> </p> <p>我们知道åQŒåœ¨å­ç±»¾l§æ‰¿çˆ¶ç±»ä¹‹åŽåQŒå¦‚果子¾cÖM¸Žçˆ¶ç±»æœ‰åŒåçš„字段和方法,那么子类中的子段会代替或隐藏父类的子ŒDµï¼Œè¯´æ˜Žå­ç±»å­—段覆盖了超¾cÕd­—ŒDµï¼Œä½†å¯ä»¥é€šè¿‡super关键字去讉K—®­‘…类字段。但是,在我们将子类对象向超¾c»è{型的时候就会发生这个奇怪的现象åQŒå­¾cÕd¯¹è±¡å±…然可以看到父¾cÀL›¾¾lè¢«è¦†ç›–掉的字段åQå°±æ­£å¦‚ä¸‹é¢ä¾‹å­ä¸­ä¸€æ øP¼š</p> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <span style="COLOR: #008080"> 1</span> <span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> A{<br /></span><span style="COLOR: #008080"> 2</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">boolean</span><span style="COLOR: #000000"> bb </span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">false</span><span style="COLOR: #000000">;<br /></span><span style="COLOR: #008080"> 3</span> <span style="COLOR: #000000">}<br /></span><span style="COLOR: #008080"> 4</span> <span style="COLOR: #000000"><br /></span><span style="COLOR: #008080"> 5</span> <span style="COLOR: #000000"></span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">class</span><span style="COLOR: #000000"> B </span><span style="COLOR: #0000ff">extends</span><span style="COLOR: #000000"> A{<br /></span><span style="COLOR: #008080"> 6</span> <span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">boolean</span><span style="COLOR: #000000"> bb </span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">true</span><span style="COLOR: #000000">;<br /></span><span style="COLOR: #008080"> 7</span> <span style="COLOR: #000000">    </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">int a=1;</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080"> 8</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    </span><span style="COLOR: #0000ff">public</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">static</span><span style="COLOR: #000000"> </span><span style="COLOR: #0000ff">void</span><span style="COLOR: #000000"> main(String[] args) {<br /></span><span style="COLOR: #008080"> 9</span> <span style="COLOR: #000000">        B b </span><span style="COLOR: #000000">=</span><span style="COLOR: #0000ff">new</span><span style="COLOR: #000000"> B();<br /></span><span style="COLOR: #008080">10</span> <span style="COLOR: #000000">        A a ;<br /></span><span style="COLOR: #008080">11</span> <span style="COLOR: #000000">        a</span><span style="COLOR: #000000">=</span><span style="COLOR: #000000"> b;<br /></span><span style="COLOR: #008080">12</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">---åQŸï¼Ÿ</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">13</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        System.out.println(a.bb);<br /></span><span style="COLOR: #008080">14</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">---˜q™å¥å¯ä»¥ç†è§£</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">15</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        System.out.println(b.bb);<br /></span><span style="COLOR: #008080">16</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">---åQŸï¼Ÿ</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">17</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">        System.out.println( ((A)b).bb);<br /></span><span style="COLOR: #008080">18</span> <span style="COLOR: #000000">        </span><span style="COLOR: #008000">//</span><span style="COLOR: #008000">----</span><span style="COLOR: #008000"><br /></span><span style="COLOR: #008080">19</span> <span style="COLOR: #008000"></span><span style="COLOR: #000000">    }<br /></span><span style="COLOR: #008080">20</span> <span style="COLOR: #000000">    </span><span style="COLOR: #008000">/*</span><span style="COLOR: #008000">˜qè¡Œ¾l“æžœ<br /></span><span style="COLOR: #008080">21</span> <span style="COLOR: #008000">     * false<br /></span><span style="COLOR: #008080">22</span> <span style="COLOR: #008000">     * true<br /></span><span style="COLOR: #008080">23</span> <span style="COLOR: #008000">     * false<br /></span><span style="COLOR: #008080">24</span> <span style="COLOR: #008000">     * </span><span style="COLOR: #008000">*/</span><span style="COLOR: #000000"><br /></span><span style="COLOR: #008080">25</span> <span style="COLOR: #000000">}</span></div> <br />ä¸ÞZ»€ä¹ˆä¼šå‘生˜q™æ ·çš„æƒ…况呢åQ?br />关于˜q™ç§æƒ…况的解释在[¾ŸŽ]Peter van der Linden著的《Just Java2》中有了½{”案:<br />P106他说åQ?br />   一定要注意åQšå½“把子¾c»è{换成­‘…ç±»æ—Óž¼Œå­ç±»å¯ä»¥è§åˆ°æˆ–访问被隐藏的同名变量。Java允许名字重复的原因是åQŒå…è®¸å°†æ¥æŠŠæ–°çš„字段加到­‘…类中,而不影响已经使用了该名字的现有子¾c»ï¼Œå­ç±»ž®†ä¼š¾l§ç®‹ä½¿ç”¨è‡ªå·±çš„å­—ŒDµå‰¯æœ¬ã€?font color="#ff1493">除非让子¾cÖM»¥­‘…类对象的åŞ式出玎ͼŒæ–ÒŽ³•可以覆盖åQŒä½†æ˜¯å­—ŒDµä¸èƒ½è¢«è¦†ç›–。注意:最好不要隐藏超¾cÖM¸­çš„å­—ŒDµåã€?br />     </font><font color="#000000">所以我们在˜q›è¡Œå‘上转型的时候一定要注意åQšä¸è¦è®¿é—®å­¾cÖM¸­é‚£äº›â€œè¦†ç›–”掉父类的字ŒDµï¼ˆå®ƒåƈ没有真正覆盖掉,在向上è{型的时候就可以讉K—®çš„到åQ‰ï¼Œè¦ä¹ˆž®†å­¾cÕd­—ŒD‰|”¹åï¼ˆåœ¨ä½ çŸ¥é“父类代码的情况下åQ‰ï¼Œè¦ä¹ˆé€šè¿‡æ–ÒŽ³•来访问字¾cÕd­—ŒDµï¼ˆæ–ÒŽ³•即ä‹É同名也肯定能覆盖掉)ã€?/font><img src ="http://www.aygfsteel.com/galaxyly/aggbug/107614.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/galaxyly/" target="_blank">é“¶æ²³‹¹ïL›—</a> 2007-03-31 11:31 <a href="http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107614.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>¾l§æ‰¿å¸¦å‚数构造器的超¾cÕdƈ且调用自íw«å…¶ä»–构造器的讨è®?/title><link>http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107610.html</link><dc:creator>é“¶æ²³‹¹ïL›—</dc:creator><author>é“¶æ²³‹¹ïL›—</author><pubDate>Sat, 31 Mar 2007 02:56:00 GMT</pubDate><guid>http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107610.html</guid><wfw:comment>http://www.aygfsteel.com/galaxyly/comments/107610.html</wfw:comment><comments>http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107610.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/galaxyly/comments/commentRss/107610.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/galaxyly/services/trackbacks/107610.html</trackback:ping><description><![CDATA[ <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">首先有一个带参数的超¾c»ï¼šÂ </span> <span style="COLOR: #008000"> <br /> <img id="Codehighlighter1_32_143_Open_Image" onclick="this.style.display='none'; Codehighlighter1_32_143_Open_Text.style.display='none'; Codehighlighter1_32_143_Closed_Image.style.display='inline'; Codehighlighter1_32_143_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_32_143_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_32_143_Closed_Text.style.display='none'; Codehighlighter1_32_143_Open_Image.style.display='inline'; Codehighlighter1_32_143_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000"> SuperClass</span> <span id="Codehighlighter1_32_143_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_32_143_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />   String str</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">create superClass obj</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">; <br /><img id="Codehighlighter1_97_140_Open_Image" onclick="this.style.display='none'; Codehighlighter1_97_140_Open_Text.style.display='none'; Codehighlighter1_97_140_Closed_Image.style.display='inline'; Codehighlighter1_97_140_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_97_140_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_97_140_Closed_Text.style.display='none'; Codehighlighter1_97_140_Open_Image.style.display='inline'; Codehighlighter1_97_140_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   SuperClass(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000"> num)</span> <span id="Codehighlighter1_97_140_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_97_140_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />       System.out.println(num</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">str); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /><img id="Codehighlighter1_146_202_Open_Image" onclick="this.style.display='none'; Codehighlighter1_146_202_Open_Text.style.display='none'; Codehighlighter1_146_202_Closed_Image.style.display='inline'; Codehighlighter1_146_202_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_146_202_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_146_202_Closed_Text.style.display='none'; Codehighlighter1_146_202_Open_Image.style.display='inline'; Codehighlighter1_146_202_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_146_202_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span> <span id="Codehighlighter1_146_202_Open_Text"> <span style="COLOR: #008000">/*</span> <span style="COLOR: #008000"> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />现在有一个子¾cȝ‘ô承了˜q™ä¸ª­‘…ç±»åQŒé‚£ä¹ˆè¿™ä¸ªå­¾cÕdº”该显式的调用­‘…类的构造函敎ͼŒä»¥ä¾¿åˆå§‹åŒ–自å·Þqš„父类,如下。Â?br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /></span> <span style="COLOR: #008000">*/</span> </span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_237_288_Open_Image" onclick="this.style.display='none'; Codehighlighter1_237_288_Open_Text.style.display='none'; Codehighlighter1_237_288_Closed_Image.style.display='inline'; Codehighlighter1_237_288_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_237_288_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_237_288_Closed_Text.style.display='none'; Codehighlighter1_237_288_Open_Image.style.display='inline'; Codehighlighter1_237_288_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000"> SubClass </span> <span style="COLOR: #0000ff">extends</span> <span style="COLOR: #000000"> SuperClass</span> <span id="Codehighlighter1_237_288_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_237_288_Open_Text"> <span style="COLOR: #000000">{ <br /><img id="Codehighlighter1_260_285_Open_Image" onclick="this.style.display='none'; Codehighlighter1_260_285_Open_Text.style.display='none'; Codehighlighter1_260_285_Closed_Image.style.display='inline'; Codehighlighter1_260_285_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_260_285_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_260_285_Closed_Text.style.display='none'; Codehighlighter1_260_285_Open_Image.style.display='inline'; Codehighlighter1_260_285_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   SubClass(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000"> num)</span> <span id="Codehighlighter1_260_285_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_260_285_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      </span> <span style="COLOR: #0000ff">super</span> <span style="COLOR: #000000">(num); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /><img id="Codehighlighter1_291_341_Open_Image" onclick="this.style.display='none'; Codehighlighter1_291_341_Open_Text.style.display='none'; Codehighlighter1_291_341_Closed_Image.style.display='inline'; Codehighlighter1_291_341_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_291_341_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_291_341_Closed_Text.style.display='none'; Codehighlighter1_291_341_Open_Image.style.display='inline'; Codehighlighter1_291_341_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_291_341_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span> <span id="Codehighlighter1_291_341_Open_Text"> <span style="COLOR: #008000">/*</span> <span style="COLOR: #008000"> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />现在子类˜q˜è¦å®šä¹‰ä¸€ä¸ªæ–°çš„æž„造函敎ͼŒòq¶ä¸”在前一个构造函æ•îC¸­è°ƒç”¨˜q™ä¸ªæ–°çš„æž„造函敎ͼŒæ›´æ”¹å¦‚下åQšÂ?br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /></span> <span style="COLOR: #008000">*/</span> </span> <span style="COLOR: #000000"> <br /> <img id="Codehighlighter1_376_599_Open_Image" onclick="this.style.display='none'; Codehighlighter1_376_599_Open_Text.style.display='none'; Codehighlighter1_376_599_Closed_Image.style.display='inline'; Codehighlighter1_376_599_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_376_599_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_376_599_Closed_Text.style.display='none'; Codehighlighter1_376_599_Open_Image.style.display='inline'; Codehighlighter1_376_599_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000"> SubClass </span> <span style="COLOR: #0000ff">extends</span> <span style="COLOR: #000000"> SuperClass</span> <span id="Codehighlighter1_376_599_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_376_599_Open_Text"> <span style="COLOR: #000000">{ <br /><img id="Codehighlighter1_399_463_Open_Image" onclick="this.style.display='none'; Codehighlighter1_399_463_Open_Text.style.display='none'; Codehighlighter1_399_463_Closed_Image.style.display='inline'; Codehighlighter1_399_463_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_399_463_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_399_463_Closed_Text.style.display='none'; Codehighlighter1_399_463_Open_Image.style.display='inline'; Codehighlighter1_399_463_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   SubClass(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000"> num)</span> <span id="Codehighlighter1_399_463_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_399_463_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      </span> <span style="COLOR: #0000ff">super</span> <span style="COLOR: #000000">(num); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      </span> <span style="COLOR: #0000ff">this</span> <span style="COLOR: #000000">(</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">other SubClass(String)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000"> <br /><img id="Codehighlighter1_487_523_Open_Image" onclick="this.style.display='none'; Codehighlighter1_487_523_Open_Text.style.display='none'; Codehighlighter1_487_523_Closed_Image.style.display='inline'; Codehighlighter1_487_523_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_487_523_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_487_523_Closed_Text.style.display='none'; Codehighlighter1_487_523_Open_Image.style.display='inline'; Codehighlighter1_487_523_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   SubClass(String s)</span> <span id="Codehighlighter1_487_523_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_487_523_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      System.out.println(s); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000"> <br /><img id="Codehighlighter1_567_596_Open_Image" onclick="this.style.display='none'; Codehighlighter1_567_596_Open_Text.style.display='none'; Codehighlighter1_567_596_Closed_Image.style.display='inline'; Codehighlighter1_567_596_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_567_596_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_567_596_Closed_Text.style.display='none'; Codehighlighter1_567_596_Open_Image.style.display='inline'; Codehighlighter1_567_596_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   </span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">static</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000"> main(String[] args)</span> <span id="Codehighlighter1_567_596_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_567_596_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      </span> <span style="COLOR: #0000ff">new</span> <span style="COLOR: #000000"> SubClass(); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /><img id="Codehighlighter1_602_717_Open_Image" onclick="this.style.display='none'; Codehighlighter1_602_717_Open_Text.style.display='none'; Codehighlighter1_602_717_Closed_Image.style.display='inline'; Codehighlighter1_602_717_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_602_717_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_602_717_Closed_Text.style.display='none'; Codehighlighter1_602_717_Open_Image.style.display='inline'; Codehighlighter1_602_717_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span id="Codehighlighter1_602_717_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff">/**/</span> <span id="Codehighlighter1_602_717_Open_Text"> <span style="COLOR: #008000">/*</span> <span style="COLOR: #008000"> <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />ç”׃ºŽæˆ‘们知道在一个类中的构造函æ•îC¸­è¦è°ƒç”¨è‡ªå·Þqš„其他构造函敎ͼŒåªèƒ½é€šè¿‡this();的方式调用一个,òq¶ä¸”要放在所在构造函数的½W¬ä¸€è¡Œï¼Œä½†æ˜¯ä½¿ç”¨super();昑ּè°ƒç”¨ä¹Ÿçˆ¶¾cÕd¸¦å‚构造函æ•îC¹Ÿåªèƒ½æ”‘Öœ¨½W¬ä¸€è¡Œï¼Œé‚£ä¹ˆ˜q™æ ·ž®×ƒ¼šå‘生冲突ã€?br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" /></span> <span style="COLOR: #008000">*/</span> </span> </div> <div style="BORDER-RIGHT: #cccccc 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #cccccc 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 13px; PADDING-BOTTOM: 4px; BORDER-LEFT: #cccccc 1px solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: #cccccc 1px solid; BACKGROUND-COLOR: #eeeeee"> <img src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align="top" /> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">参考: </span> <span style="COLOR: #008000"> <br /> <img id="Codehighlighter1_31_141_Open_Image" onclick="this.style.display='none'; Codehighlighter1_31_141_Open_Text.style.display='none'; Codehighlighter1_31_141_Closed_Image.style.display='inline'; Codehighlighter1_31_141_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /> <img id="Codehighlighter1_31_141_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_31_141_Closed_Text.style.display='none'; Codehighlighter1_31_141_Open_Image.style.display='inline'; Codehighlighter1_31_141_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /> </span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000"> SuperClass </span> <span id="Codehighlighter1_31_141_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_31_141_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />String str</span> <span style="COLOR: #000000">=</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">create superClass obj</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">;  <br /><img id="Codehighlighter1_92_137_Open_Image" onclick="this.style.display='none'; Codehighlighter1_92_137_Open_Text.style.display='none'; Codehighlighter1_92_137_Closed_Image.style.display='inline'; Codehighlighter1_92_137_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_92_137_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_92_137_Closed_Text.style.display='none'; Codehighlighter1_92_137_Open_Image.style.display='inline'; Codehighlighter1_92_137_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> SuperClass(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000"> num)</span> <span id="Codehighlighter1_92_137_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_92_137_Open_Text"> <span style="COLOR: #000000">{  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />       System.out.println(num</span> <span style="COLOR: #000000">+</span> <span style="COLOR: #000000">str);  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000">  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> <span style="COLOR: #000000"> <br /><img id="Codehighlighter1_185_536_Open_Image" onclick="this.style.display='none'; Codehighlighter1_185_536_Open_Text.style.display='none'; Codehighlighter1_185_536_Closed_Image.style.display='inline'; Codehighlighter1_185_536_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" /><img id="Codehighlighter1_185_536_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_185_536_Closed_Text.style.display='none'; Codehighlighter1_185_536_Open_Image.style.display='inline'; Codehighlighter1_185_536_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" /></span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">class</span> <span style="COLOR: #000000"> SubClass </span> <span style="COLOR: #0000ff">extends</span> <span style="COLOR: #000000"> SuperClass </span> <span id="Codehighlighter1_185_536_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_185_536_Open_Text"> <span style="COLOR: #000000">{ <br /><img id="Codehighlighter1_208_277_Open_Image" onclick="this.style.display='none'; Codehighlighter1_208_277_Open_Text.style.display='none'; Codehighlighter1_208_277_Closed_Image.style.display='inline'; Codehighlighter1_208_277_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_208_277_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_208_277_Closed_Text.style.display='none'; Codehighlighter1_208_277_Open_Image.style.display='inline'; Codehighlighter1_208_277_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   SubClass(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000"> num)</span> <span id="Codehighlighter1_208_277_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_208_277_Open_Text"> <span style="COLOR: #000000">{  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      </span> <span style="COLOR: #0000ff">super</span> <span style="COLOR: #000000">(num);  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      sub(num,</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">other Subclass(String)</span> <span style="COLOR: #000000">"</span> <span style="COLOR: #000000">); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000">  <br /><img id="Codehighlighter1_310_363_Open_Image" onclick="this.style.display='none'; Codehighlighter1_310_363_Open_Text.style.display='none'; Codehighlighter1_310_363_Closed_Image.style.display='inline'; Codehighlighter1_310_363_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_310_363_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_310_363_Closed_Text.style.display='none'; Codehighlighter1_310_363_Open_Image.style.display='inline'; Codehighlighter1_310_363_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   SubClass(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000"> num,String s)</span> <span id="Codehighlighter1_310_363_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_310_363_Open_Text"> <span style="COLOR: #000000">{  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      </span> <span style="COLOR: #0000ff">super</span> <span style="COLOR: #000000">(num); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />  System.out.println(s);  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000"> <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span> <span style="COLOR: #008000">//</span> <span style="COLOR: #008000">------------- </span> <span style="COLOR: #008000"> <br /> <img id="Codehighlighter1_419_457_Open_Image" onclick="this.style.display='none'; Codehighlighter1_419_457_Open_Text.style.display='none'; Codehighlighter1_419_457_Closed_Image.style.display='inline'; Codehighlighter1_419_457_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /> <img id="Codehighlighter1_419_457_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_419_457_Closed_Text.style.display='none'; Codehighlighter1_419_457_Open_Image.style.display='inline'; Codehighlighter1_419_457_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" /> </span> <span style="COLOR: #000000">   SubClass sub(</span> <span style="COLOR: #0000ff">int</span> <span style="COLOR: #000000"> num,String s)</span> <span id="Codehighlighter1_419_457_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_419_457_Open_Text"> <span style="COLOR: #000000">{ <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />   </span> <span style="COLOR: #0000ff">return</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">new</span> <span style="COLOR: #000000"> SubClass(num,s); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000"> <br /><img id="Codehighlighter1_501_532_Open_Image" onclick="this.style.display='none'; Codehighlighter1_501_532_Open_Text.style.display='none'; Codehighlighter1_501_532_Closed_Image.style.display='inline'; Codehighlighter1_501_532_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" /><img id="Codehighlighter1_501_532_Closed_Image" style="DISPLAY: none" onclick="this.style.display='none'; Codehighlighter1_501_532_Closed_Text.style.display='none'; Codehighlighter1_501_532_Open_Image.style.display='inline'; Codehighlighter1_501_532_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" />   </span> <span style="COLOR: #0000ff">public</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">static</span> <span style="COLOR: #000000"> </span> <span style="COLOR: #0000ff">void</span> <span style="COLOR: #000000"> main(String[] args)</span> <span id="Codehighlighter1_501_532_Closed_Text" style="BORDER-RIGHT: #808080 1px solid; BORDER-TOP: #808080 1px solid; DISPLAY: none; BORDER-LEFT: #808080 1px solid; BORDER-BOTTOM: #808080 1px solid; BACKGROUND-COLOR: #ffffff"> <img src="http://www.aygfsteel.com/images/dot.gif" /> </span> <span id="Codehighlighter1_501_532_Open_Text"> <span style="COLOR: #000000">{  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" />      </span> <span style="COLOR: #0000ff">new</span> <span style="COLOR: #000000"> SubClass(</span> <span style="COLOR: #000000">1</span> <span style="COLOR: #000000">); <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" />   }</span> </span> <span style="COLOR: #000000">  <br /><img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" />}</span> </span> </div> <img src ="http://www.aygfsteel.com/galaxyly/aggbug/107610.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/galaxyly/" target="_blank">é“¶æ²³‹¹ïL›—</a> 2007-03-31 10:56 <a href="http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107610.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于名称屏蔽讨论http://www.aygfsteel.com/galaxyly/archive/2007/03/31/107609.htmlé“¶æ²³‹¹ïL›—é“¶æ²³‹¹ïL›—Sat, 31 Mar 2007 02:53:00 GMThttp://www.aygfsteel.com/galaxyly/archive/2007/03/31/107609.htmlhttp://www.aygfsteel.com/galaxyly/comments/107609.htmlhttp://www.aygfsteel.com/galaxyly/archive/2007/03/31/107609.html#Feedback0http://www.aygfsteel.com/galaxyly/comments/commentRss/107609.htmlhttp://www.aygfsteel.com/galaxyly/services/trackbacks/107609.html
public class SuperClass { 
public void method(){ 
System.out.println(
"super method() worked."); 
}
 
public void method(int a){ 
System.out.println(
"super method(int) worked"); 
}
 
public void method(String s){ 
System.out.println(
"super method(string) worked"); 
}
 
}
 
//------------sub--------------- 
public class SubClass extends SuperClass { 
  
public void method(){ 
  System.out.println(
"subclass method() worked"); 
  }
 
  
public void method(int a){ 
  
super.method(a); 
  }
 
  
public void method(char c){ 
  System.out.println(
"subclass method(char) worked"); 
  }
 
}
 
//------------run--------------- 
public class Test { 
public static void run(SuperClass a){ 
a.method(); 
a.method(
1); 
a.method(
"string"); 
}
 
public static void main(String[] args) { 
run(
new SubClass()); 
new SubClass().method('r'); 
}
 
}
 
//=============END=============== 
subclass method() worked 
super method(int) worked 
super method(string) worked 
subclass method(
char) worked 
//=============END=============== 



é“¶æ²³‹¹ïL›— 2007-03-31 10:53 发表评论
]]>
学习SWING头一遭!http://www.aygfsteel.com/galaxyly/archive/2006/07/08/57218.htmlé“¶æ²³‹¹ïL›—é“¶æ²³‹¹ïL›—Fri, 07 Jul 2006 16:37:00 GMThttp://www.aygfsteel.com/galaxyly/archive/2006/07/08/57218.htmlhttp://www.aygfsteel.com/galaxyly/comments/57218.htmlhttp://www.aygfsteel.com/galaxyly/archive/2006/07/08/57218.html#Feedback0http://www.aygfsteel.com/galaxyly/comments/commentRss/57218.htmlhttp://www.aygfsteel.com/galaxyly/services/trackbacks/57218.html 发现 swing 中对控äšg的布局很麻烦,要想整个好看的界面确实是件烦人的事情åQŒæˆ‘做了一个简单的界面åQŒä»£ç å¦‚下:

 

package  gui;

import  java.awt.BorderLayout;
import  java.awt.GridLayout;
import  javax.swing.JButton;
import  javax.swing.JFrame;
import  javax.swing.JLabel;
import  javax.swing.JPanel;
import  javax.swing.JTextField;
import  javax.swing.JToolBar;
public   class  UserGui  extends  JFrame { 
    
static   final   long  serialVersionUID  =   1 ;
    JPanel infBar;
    JButton[] button 
=   new  JButton[ 6 ];
    JToolBar tb;
    
//  ----------
    JLabel idL  =   new  JLabel( " 工号åQ?/span> " );
    JLabel nameL 
=   new  JLabel( " 姓名åQ?/span> " );
    JLabel moneyL 
=   new  JLabel( " 学历åQ?/span> " );
    JLabel workL 
=   new  JLabel( " 职称åQ?/span> " );
    JTextField idT 
=   new  JTextField( 22 );
    JTextField nameT 
=   new  JTextField( 22 );
    JTextField moneyT 
=   new  JTextField( 22 );
    JTextField workT 
=   new  JTextField( 22 );
    
//  --------------------------------
     public  UserGui(String name) {
        
super (name);
        setLayout(
new  BorderLayout());
        setDefaultCloseOperation(EXIT_ON_CLOSE);
        setSize(
290 ,  200 );
        setResizable(
false );
        setToolBar();
        setInfBar();
        add(infBar, BorderLayout.CENTER);
        add(tb, BorderLayout.NORTH);
        setVisible(
true );
    }
    
//  --------------------------------
     public   void  setToolBar() {
        tb 
=   new  JToolBar();
        tb.setFloatable(
false );
        String[] t1 
=  {  " 查询 " ,  " æ·ÕdŠ  " ,  " 修改 " ,  " 删除 " ,  " 应用更改 " ,  " 退出系¾l?/span> "  };
        
for  ( int  i  =   0 ; i  <   6 ; i ++ ) {
            button[i] 
=   new  JButton(t1[i]);
            tb.add(button[i]);
        }
    }
    
public   void  setInfBar() {
        infBar 
=   new  JPanel();
        infBar.setLayout(
new  BorderLayout());
        JPanel left 
=   new  JPanel();
        left.setLayout(
new  GridLayout( 4 ,  1 ));
        JPanel right 
=   new  JPanel();
        right.setLayout(
new  GridLayout( 4 ,  1 ));
        infBar.add(left, BorderLayout.WEST);
        infBar.add(right, BorderLayout.EAST);
        left.add(idL);
        left.add(nameL);
        left.add(moneyL);
        left.add(workL);
        right.add(idT);
        right.add(nameT);
        right.add(moneyT);
        right.add(workT);
    }
    
//  --------------------------------
     public   static   void  main(String[] args) {
        UserGui ug 
=   new  UserGui( " äºÞZº‹æ¡£æ¡ˆ½Ž¡ç†¾pȝ»Ÿç•Œé¢ " );
    }    
}


é“¶æ²³‹¹ïL›— 2006-07-08 00:37 发表评论
]]>
Ö÷Õ¾Ö©Öë³ØÄ£°å£º Äþ½òÏØ| ÃϽòÏØ| Î人ÊÐ| Õò½­ÊÐ| ±±³½Çø| ¼ªÊ×ÊÐ| °ÍÁÖÓÒÆì| ÉÐÖ¾ÊÐ| º£ÄÏÊ¡| ÁÉÑôÏØ| ÓñÁÖÊÐ| ¶«ÀöÇø| °¢À­ÉÆÓÒÆì| ¼ÎÒåÏØ| °²´ïÊÐ| ÁÖµéÏØ| ´óͬÊÐ| ¡×ÓÏØ| ¹Ê³ÇÏØ| ¶¨ÏåÏØ| ÕżҴ¨| ÈÄÆ½ÏØ| ÁÖ¿ÚÏØ| Âí¹ØÏØ| Íû½­ÏØ| ÓÑÒêÏØ| ËÉÌÒ| ËÞËÉÏØ| ÕýÏâ°×Æì| ¹ã°²ÊÐ| Âó¸ÇÌáÏØ| Çì³ÇÏØ| ÓÀºÍÏØ| ÓãÌ¨ÏØ| Íå×ÐÇø| ÕÃÎäÏØ| ¸§Ë³ÊÐ| ¼¦ÔóÏØ| ¶«ÎÚÖéÄÂÇ߯ì| ÁÙå¢ÏØ| ʯÊ×ÊÐ|