锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久久久久久久99精品,亚洲综合电影一区二区三区,男人的天堂久久http://www.aygfsteel.com/hanbihui/category/25961.html涓涓漢鍘繪祦嫻?/description>zh-cnWed, 19 Sep 2007 17:39:10 GMTWed, 19 Sep 2007 17:39:10 GMT60寮曞厓鏁伴噺鍙彉鐨勬柟娉?/title><link>http://www.aygfsteel.com/hanbihui/archive/2007/09/19/146428.html</link><dc:creator>嫻佹氮闊?/dc:creator><author>嫻佹氮闊?/author><pubDate>Wed, 19 Sep 2007 05:06:00 GMT</pubDate><guid>http://www.aygfsteel.com/hanbihui/archive/2007/09/19/146428.html</guid><wfw:comment>http://www.aygfsteel.com/hanbihui/comments/146428.html</wfw:comment><comments>http://www.aygfsteel.com/hanbihui/archive/2007/09/19/146428.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/hanbihui/comments/commentRss/146428.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/hanbihui/services/trackbacks/146428.html</trackback:ping><description><![CDATA[<p align="center">寮曞厓鏁伴噺鍙彉鐨勬柟娉?/p> <p>public class Test {<br />     public void test(String... body){</p> <p>//String...浠h〃String鐨勬暟緇勶紝闀垮害鐢變紶榪涙潵鏃剁殑鏁扮粍闀垮害鍐沖畾<br />         for (int i = 0; i < body.length; i++) {<br />             System.out.print(body[i]);<br />         }</p> <p>        System.out.println();<br />     }<br /> }</p> <p>public class Main {<br />     public static void main(String[] args) {<br />         Test t=new Test();<br />         t.test("hello,","hi");<br />         t.test("good morning");<br />         t.test("good afternoon,","good evening,","good night");<br />     }<br /> }<br /> 杈撳嚭緇撴灉錛?br /> hello,hi<br /> good morning<br /> good afternoon,good evening,good night</p> <img src ="http://www.aygfsteel.com/hanbihui/aggbug/146428.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/hanbihui/" target="_blank">嫻佹氮闊?/a> 2007-09-19 13:06 <a href="http://www.aygfsteel.com/hanbihui/archive/2007/09/19/146428.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>澧炲己鐨刦or璇彞http://www.aygfsteel.com/hanbihui/archive/2007/09/19/146425.html嫻佹氮闊?/dc:creator>嫻佹氮闊?/author>Wed, 19 Sep 2007 04:58:00 GMThttp://www.aygfsteel.com/hanbihui/archive/2007/09/19/146425.htmlhttp://www.aygfsteel.com/hanbihui/comments/146425.htmlhttp://www.aygfsteel.com/hanbihui/archive/2007/09/19/146425.html#Feedback0http://www.aygfsteel.com/hanbihui/comments/commentRss/146425.htmlhttp://www.aygfsteel.com/hanbihui/services/trackbacks/146425.html澧炲己鐨刦or璇彞


    澧炲己鐨刦or璇彞褰㈠紡濡備笅錛?br />     for(Type loop-variable:set - expression)
         statement
    鍏朵腑set - expression蹇呴』涓虹‘瀹氱殑瀵硅薄錛岃繖涓璞℃槸鎴戜滑鎯寵榪唬鐨勬暟鍊肩殑闆嗗悎銆俵oop-variable鏄竴涓眬閮ㄥ彉閲忥紝瀹冪殑綾誨瀷Type蹇呴』閫傚悎浜庢暟鍊奸泦鍚坰et - expression鐨勫唴瀹癸紝姣忔榪涜寰幆鏃訛紝loop-variable閮戒細(xì)浠巗et - expression鍙栧嚭涓嬩竴涓鹼紝鐒跺悗鎵цstatement錛岀洿鍒板彇瀹岄泦鍚堜腑鐨勬暟鎹?br />     set - expression蹇呴』鏄暟緇勬垨鑰呭疄鐜頒簡(jiǎn)java.lang.Iterable鎺ュ彛鐨勫璞?br />    
    瀹冪殑濂藉鏄笉鐢ㄦ墜宸ョ淮鎶ゆ暟緇勪笅鏍囷紝涔熶笉蹇呮鏌ユ暟緇勭殑闀垮害銆?br />     瀹冪殑緙虹偣鏄彧鑳藉湪鍗曠嫭鐨勪竴涓暟緇勪笂鍚戝墠寰幆錛屽茍涓斿彧鑳芥煡鐪嬫暟緇勭殑鍏冪礌   
 
    涓嬮潰鏄緥瀛愶細(xì)
 
import java.util.Vector;

public class ForEx {

 

    public static void main(String[] args) {
        Vector<String> v=new Vector<String>();

        v.add("Hello");
        v.add("Hi");
        v.add("Good Moning");

 

        for (String string : v) {
            System.out.println(string);
        }
    }
}

杈撳嚭緇撴灉錛?/p>

Hello
Hi
Good Moning

 

濡傛灉榪欎釜“澧炲己鐨刦or璇彞”鍜?#8220;寮曞厓鏁伴噺鍙彉鐨勬柟娉?#8221;鑱斿悎璧鋒潵涓璧風(fēng)敤鐨勮瘽浼?xì)鏈変笉閿欑殑鏁堟灉锛?xì)

 

public class Test {

    public static void main(String[] args) {
        Test t=new Test();
        t.test("hello,","hi");
        t.test("good morning");
        t.test("good afternoon,","good evening,","good night");
    }

    public void test(String... body){

//String...浠h〃String鐨勬暟緇勶紝闀垮害鐢變紶榪涙潵鏃剁殑鏁扮粍闀垮害鍐沖畾
        for (String string : body) {
            System.out.println(string);
        }
    }
}

杈撳嚭濡備笅錛?/p>

hello,
hi
good morning
good afternoon,
good evening,
good night



]]>
鏍囧彿涓巆ontinue,breakhttp://www.aygfsteel.com/hanbihui/archive/2007/09/18/146250.html嫻佹氮闊?/dc:creator>嫻佹氮闊?/author>Tue, 18 Sep 2007 12:48:00 GMThttp://www.aygfsteel.com/hanbihui/archive/2007/09/18/146250.htmlhttp://www.aygfsteel.com/hanbihui/comments/146250.htmlhttp://www.aygfsteel.com/hanbihui/archive/2007/09/18/146250.html#Feedback0http://www.aygfsteel.com/hanbihui/comments/commentRss/146250.htmlhttp://www.aygfsteel.com/hanbihui/services/trackbacks/146250.html鏍囧彿涓巆ontinue,break


    鍙互緇欒鍙ュ潡鍔犳爣鍙瘋祴浜堝畠浠悕縐幫紝鏍囧彿浣嶄簬璇彞涔嬪墠銆傛爣鍙峰彧鑳借continue鍜宐reak寮曠敤銆傛牸寮忓涓嬶細(xì)
    label:statement
    璇彞鍓嶅彧鍏佽鍔犱竴涓爣鍙鳳紝鏍囧彿鍚庨潰涓嶈兘璺熷ぇ鎷彿銆傞氳繃鐢╞reak鍚庡姞鏍囧彿瀵瑰浜庢爣鍙蜂腑鐨勮鍙ヨ繘琛屾帶鍒躲傚線寰鏍囧彿鍚庢槸for.while.do-while絳夊驚鐜?br />     閫氳繃鐢ㄦ爣鍙鳳紝鎴戜滑鍙互瀵瑰灞傚驚鐜繘琛屾帶鍒?br /> 涓嬮潰鏄敤continue鎺у埗鏍囧彿
public class Label {

    public static void main(String[] args) {
        System.out.println("i j");
        search:
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 50; j++) {
                    if (j == 3)
                        continue search;
                    System.out.println(i+" "+j);
                }
            }
    }
}
杈撳嚭濡備笅錛?/p>

i j
0 0
0 1
0 2
1 0
1 1
1 2
2 0
2 1
2 2


鍙互鐪嬪嚭鍐呭眰寰幆騫舵病鏈夋墽琛?0嬈★紝鑰屽埌浜?jiǎn)continue鏃跺氨璺沖埌鏈澶栧眰寰幆鍘諱簡(jiǎn)錛宑ontinue鎵ц鍚庢墽琛岀殑鏄痠++.

 

涓嬮潰鏄敤break鎺у埗鏍囧彿

public class Label {

    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println("i j");
        search:
            for (int i = 0; i < 3; i++) {
                for (int j = 0; j < 50; j++) {
                    if (j == 3)
                        break search;
                    System.out.println(i+" "+j);
                }
            }
    }
}

杈撳嚭濡備笅錛?/p>

i j
0 0
0 1
0 2
 

鍙互鐪嬪嚭鍐呭眰寰幆涔熸病鏈夋墽琛?0嬈★紝鑰屼笖break鍚庡驚鐜氨鍐嶄篃娌℃墽琛屻俠reak璺沖嚭鐨勬槸鏈澶栧眰寰幆錛岃煩鍑轟簡(jiǎn)鏍囧彿鐨勮寖鍥淬?/p>

 

break璺沖嚭鏍囧彿瀵規(guī)煡璇竴鏉¤褰曟潵璇存瘮杈冩湁鐢紝褰撴煡鍑?guó)檱繁鎯宠鐨勪竴鏉¤褰曟椂錛屽氨鍙互璺沖嚭寰幆浜?jiǎn)锛屼笉鐢ㄥ啀鎵ц浜?jiǎn)銆?/span>

鍏朵腑鏍囧彿鐨勫彟涓涓敤鎰忓氨鍦ㄤ簬璁╃▼搴忓憳涓嶅幓鐢╣oto(鏇夸唬浜?jiǎn)goto)錛屽啓鍑烘洿瀹夊叏錛屽共鍑鐨勪唬鐮?/span>



]]>
主站蜘蛛池模板: 乌兰察布市| 台州市| 蒙山县| 若羌县| 瓮安县| 连州市| 泾源县| 蒙自县| 灵石县| 资溪县| 浦北县| 乌鲁木齐县| 应城市| 贡山| 嘉义市| 澄城县| 策勒县| 保亭| 连南| 遂昌县| 仪征市| 关岭| 潢川县| 永定县| 秦皇岛市| 凉山| 南岸区| 阿鲁科尔沁旗| 延庆县| 西充县| 醴陵市| 和田市| 许昌县| 丽江市| 潜山县| 信阳市| 重庆市| 张家川| 繁昌县| 潮州市| 扶沟县|