锘??xml version="1.0" encoding="utf-8" standalone="yes"?>中文字幕亚洲一区二区va在线,精品在线手机视频,欧美综合二区http://www.aygfsteel.com/chenchuxin/articles/185289.html娌夐粯濂旇窇鑰?/dc:creator>娌夐粯濂旇窇鑰?/author>Tue, 11 Mar 2008 03:08:00 GMThttp://www.aygfsteel.com/chenchuxin/articles/185289.htmlhttp://www.aygfsteel.com/chenchuxin/comments/185289.htmlhttp://www.aygfsteel.com/chenchuxin/articles/185289.html#Feedback0http://www.aygfsteel.com/chenchuxin/comments/commentRss/185289.htmlhttp://www.aygfsteel.com/chenchuxin/services/trackbacks/185289.htmlimport java.awt.*;
import java.applet.*;

public class BubbleSort extends Applet {
    
    Label prompt
=new Label("璇瘋緭鍏ユ鎺掑簭鐨勬暣鏁版暟鎹?鏈澶?0涓?: ");
    TextField input
=new TextField(5);
    Button sortbtn
=new Button("鎺掑簭");
    
int[]  DataArray=new int[10];
    
int DataInputed=0;
    
int[][] SortPro=new int[11][10];
    
    
public void init()
    
{
        add(prompt);add(input);add(sortbtn);
    }
 
    
public void paint(Graphics g){
        
        
for(int i=0;i<SortPro.length;i++)
        
for(int j=0;j<SortPro[i].length;j++)
        g.drawString(Integer.toString(SortPro[i][j]),
10+30*j,40+20*i);
    }

    
    
    
public boolean action(Event e,Object o){
        
if(e.target==input){
            DataArray[DataInputed
++]=Integer.parseInt(input.getText());
            
if(DataInputed<10){
                prompt.setText(
"宸茶緭鍏?/span>"+DataInputed+"涓暟鎹紝璇風戶緇?/span>");
                input.setText(
"");
            }

            
else
            
{prompt.setText("宸茶緭鍏?0涓暟鎹紝涓嶈兘鍐嶈緭鍏ヤ簡");
            input.hide();        
            }

        }

        
if(e.target==sortbtn)
        
{for(int i=0;i<DataArray.length;i++)
        SortPro[
0][i]=DataArray[i];
        SortProcedure();
        repaint();
        }

        
return true;
        }

        
void SortProcedure(){
        
int pass,i,temp,exchangeCnt;
        
for(pass=0;pass<DataArray.length;pass++)
        
{
            exchangeCnt
=0;
            
for(i=0;i<DataArray.length-pass-1;i++)
    
{    if(DataArray[i]>DataArray[i+1])
        
{temp=DataArray[i];
        DataArray[i]
=DataArray[i+1];
        DataArray[i
+1]=temp;
        exchangeCnt
++;
        }

        }

        
for(i=0;i<DataArray.length;i++)
        SortPro[pass
+1][i]=DataArray[i];
        
if(exchangeCnt==0)
        
return
        }

        }

        }

        
        
        


]]>
浣跨敤鍛戒護琛屽弬鏁?/title><link>http://www.aygfsteel.com/chenchuxin/articles/185258.html</link><dc:creator>娌夐粯濂旇窇鑰?/dc:creator><author>娌夐粯濂旇窇鑰?/author><pubDate>Tue, 11 Mar 2008 01:44:00 GMT</pubDate><guid>http://www.aygfsteel.com/chenchuxin/articles/185258.html</guid><wfw:comment>http://www.aygfsteel.com/chenchuxin/comments/185258.html</wfw:comment><comments>http://www.aygfsteel.com/chenchuxin/articles/185258.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/chenchuxin/comments/commentRss/185258.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/chenchuxin/services/trackbacks/185258.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 id="Codehighlighter1_30_348_Open_Image" onclick="this.style.display='none'; Codehighlighter1_30_348_Open_Text.style.display='none'; Codehighlighter1_30_348_Closed_Image.style.display='inline'; Codehighlighter1_30_348_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_30_348_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_30_348_Closed_Text.style.display='none'; Codehighlighter1_30_348_Open_Image.style.display='inline'; Codehighlighter1_30_348_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /><span style="color: #0000ff">public</span><span style="color: #000000"> </span><span style="color: #0000ff">class</span><span style="color: #000000"> CommandLineParam </span><span id="Codehighlighter1_30_348_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" alt="" /></span><span id="Codehighlighter1_30_348_Open_Text"><span style="color: #000000">{<br /> <img id="Codehighlighter1_71_346_Open_Image" onclick="this.style.display='none'; Codehighlighter1_71_346_Open_Text.style.display='none'; Codehighlighter1_71_346_Closed_Image.style.display='inline'; Codehighlighter1_71_346_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_71_346_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_71_346_Closed_Text.style.display='none'; Codehighlighter1_71_346_Open_Image.style.display='inline'; Codehighlighter1_71_346_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />    </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_71_346_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" alt="" /></span><span id="Codehighlighter1_71_346_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">int</span><span style="color: #000000"> a1,a2,a3;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        </span><span style="color: #0000ff">if</span><span style="color: #000000">(args.length</span><span style="color: #000000"><</span><span style="color: #000000">2</span><span style="color: #000000">)<br /> <img id="Codehighlighter1_111_210_Open_Image" onclick="this.style.display='none'; Codehighlighter1_111_210_Open_Text.style.display='none'; Codehighlighter1_111_210_Closed_Image.style.display='inline'; Codehighlighter1_111_210_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_111_210_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_111_210_Closed_Text.style.display='none'; Codehighlighter1_111_210_Open_Image.style.display='inline'; Codehighlighter1_111_210_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedSubBlock.gif" align="top" alt="" />        </span><span id="Codehighlighter1_111_210_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" alt="" /></span><span id="Codehighlighter1_111_210_Open_Text"><span style="color: #000000">{<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />            System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">Not Enough command line parameters is provideed</span><span style="color: #000000">"</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.exit(</span><span style="color: #000000">0</span><span style="color: #000000">);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        <br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />        }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        a1</span><span style="color: #000000">=</span><span style="color: #000000">Integer.parseInt(args[</span><span style="color: #000000">0</span><span style="color: #000000">]);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        a2</span><span style="color: #000000">=</span><span style="color: #000000">Integer.parseInt(args[</span><span style="color: #000000">1</span><span style="color: #000000">]);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        a3</span><span style="color: #000000">=</span><span style="color: #000000">a1</span><span style="color: #000000">+</span><span style="color: #000000">a2;<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" />        System.out.println(</span><span style="color: #000000">"</span><span style="color: #000000">Add</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">a1</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">with</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">a2</span><span style="color: #000000">+</span><span style="color: #000000">"</span><span style="color: #000000">result in</span><span style="color: #000000">"</span><span style="color: #000000">+</span><span style="color: #000000">a3);<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedSubBlockEnd.gif" align="top" alt="" />    }</span></span><span style="color: #000000"><br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />}</span></span><span style="color: #000000"><br /> <img id="Codehighlighter1_350_469_Open_Image" onclick="this.style.display='none'; Codehighlighter1_350_469_Open_Text.style.display='none'; Codehighlighter1_350_469_Closed_Image.style.display='inline'; Codehighlighter1_350_469_Closed_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockStart.gif" align="top" alt="" /><img id="Codehighlighter1_350_469_Closed_Image" style="display: none" onclick="this.style.display='none'; Codehighlighter1_350_469_Closed_Text.style.display='none'; Codehighlighter1_350_469_Open_Image.style.display='inline'; Codehighlighter1_350_469_Open_Text.style.display='inline';" src="http://www.aygfsteel.com/images/OutliningIndicators/ContractedBlock.gif" align="top" alt="" /></span><span id="Codehighlighter1_350_469_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_350_469_Open_Text"><span style="color: #008000">/*</span><span style="color: #008000">D:\Program Files\Xinox Software\JCreatorV3\MyProjects\ccx9>java CommandLineParam<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/InBlock.gif" align="top" alt="" /> 31  -9<br /> <img src="http://www.aygfsteel.com/images/OutliningIndicators/ExpandedBlockEnd.gif" align="top" alt="" />Add31with-9result in22</span><span style="color: #008000">*/</span></span></div> <img src ="http://www.aygfsteel.com/chenchuxin/aggbug/185258.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/chenchuxin/" target="_blank">娌夐粯濂旇窇鑰?/a> 2008-03-11 09:44 <a href="http://www.aygfsteel.com/chenchuxin/articles/185258.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀛楃涓?http://www.aygfsteel.com/chenchuxin/archive/2008/03/10/185022.html娌夐粯濂旇窇鑰?/dc:creator>娌夐粯濂旇窇鑰?/author>Mon, 10 Mar 2008 04:25:00 GMThttp://www.aygfsteel.com/chenchuxin/archive/2008/03/10/185022.htmlhttp://www.aygfsteel.com/chenchuxin/comments/185022.htmlhttp://www.aygfsteel.com/chenchuxin/archive/2008/03/10/185022.html#Feedback5http://www.aygfsteel.com/chenchuxin/comments/commentRss/185022.htmlhttp://www.aygfsteel.com/chenchuxin/services/trackbacks/185022.htmlimport javax.swing.*;

public class StringTest2 {
    
public static void main(String args[]){
        String s1,s2,s3,s4,output;
        
        s1
=new String ("good morning");
        s2
=new String ("John");
        s3
=new String("How are you");
        s4
=new String("   how are you");
        
        output
="s1="+s1+"\ns2="+s2+"\ns3="+s3+"\ns4"+s4+"\n\n";
        
        
if(s1.equals("hello"))
    output
+="s1 equals\"hello\"\n";
        
else
        output
+="s1 dose not equal\"hello\"\n";
        
        
if (s3.equalsIgnoreCase(s4))
        output
+="s3 equals s4\n";
        
else
        output
+="s3 dose not equal s4\n";
        
        
if(s3.regionMatches(0,s4,0,5))
        output
+="First 5 characters of s3 and s4 match\n";
        
else
        output
+="First 5 characters of s3 and s4 do not match\n";
        
            
if(s3.regionMatches(true,0,s4,0,5))
        output
+="First 5 characters of s3 and s4 match\n";
        
else
        output
+="First 5 characters of s3 and s4 do not match\n";
    
        output
+="s1涓巗4榪炴帴璧鋒潵鏄細"+s1.concat(s4)+"\n";
        
        output
+="the first\"day\"of s4 is :"+s4.indexOf("you")+"\n";
        output
+="the last\"day\"of s4 is :"+s4.lastIndexOf("we");
        
        JOptionPane.showMessageDialog(
null,output,"Demonstring String Class CONstructors",JOptionPane.INFORMATION_MESSAGE);
        System.exit(
0);
    }

    
}

//p133

]]>
主站蜘蛛池模板: 喀什市| 霍邱县| 肥西县| 广灵县| 绩溪县| 彩票| 丰原市| 江都市| 酉阳| 右玉县| 洛阳市| 芒康县| 邢台市| 土默特右旗| 图木舒克市| 泰兴市| 黄石市| 营山县| 盈江县| 新源县| 江华| 喀什市| 浪卡子县| 镇坪县| 宁南县| 明溪县| 密山市| 武定县| 邳州市| 普兰县| 漳平市| 耿马| 哈尔滨市| 云林县| 灌南县| 旌德县| 虞城县| 安多县| 雷山县| 泽普县| 石柱|