All Downloads are FREE. Search and download functionalities are using the official Maven repository.

one.empty3.library.lang.statement Maven / Gradle / Ivy

There is a newer version: 2024.5.10
Show newest version
From: 
Snapshot-Content-Location: http://cui.unige.ch/isi/bnf/JAVAF/statement.html
Subject: statement
Date: Sun, 24 Jan 2021 09:10:13 -0000
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----MultipartBoundary--bLtEvulYAWPPvGwCBOxlmk306EbXaXT4LKa8DpPjHY----"


------MultipartBoundary--bLtEvulYAWPPvGwCBOxlmk306EbXaXT4LKa8DpPjHY----
Content-Type: text/html
Content-ID: 
Content-Transfer-Encoding: binary
Content-Location: http://cui.unige.ch/isi/bnf/JAVAF/statement.html

statement

statement

statement 
      ::= 
      variable_declaration 
      | ( expression ";" ) 
      | ( statement_block ) 
      | ( if_statement ) 
      | ( do_statement ) 
      | ( while_statement ) 
      | ( for_statement ) 
      | ( try_statement ) 
      | ( switch_statement ) 
      | ( "synchronized" "(" expression ")" statement ) 
      | ( "return" [ expression ] ";" ) 
      | ( "throw" expression ";" ) 
      | ( identifier ":" statement ) 
      | ( "break" [ identifier ] ";" ) 
      | ( "continue" [ identifier ] ";" ) 
      | ( ";" ) 

[rule list]
This rule is called by

-> do_statement -> for_statement -> if_statement -> statement -> statement_block -> switch_statement -> try_statement -> while_statement

Explications

Instructions de contr?le de flot

Pour les instructions de boucle et de test, vous trouverez toutes les informations n?cessaires sur les pages les concernant. Les instructions permettant l'ex?cution rep?titive sont do, while et for. Pour l'ex?cution conditionnelle, vous pouvez utiliser soit if, soit l'op?rateur "ternaire" ? d?crit ? la page expressions logiques.

return

Lorsque l'on d?clare une m?thode, si le type de celle-ci n'est pas void, alors elle retourne une valeur. Le corps de cette m?thode doit contenir au moins une instruction return. Lorsque l'on rencontre l'instruction "return val", on quitte la m?thode et on retourne la valeur qui est fournie, val dans ce cas pr?cis.

":", break et continue

break permet de sortir d'une boucle sans que l'on r??value les conditions. L'identificateur facultatif permet de sp?cifier le nom de la boucle ? quitter, au cas o? plusieurs boucles seraient imbriqu?es. continue permet de sauter les instructions restantes de la boucle, et de r??valuer imm?diatement la condition.

Exemple

// on recherche une valeur dans un tableau

int i;
for (i = 0;i < tab.length;i++) { // parcours le tableau
    if (tab[i] == recherche)
        break;
}
System.out.println("l'element "+recherche+" a ete trouve a l'index "+i);
Nous l'avons dit, si plusieurs boucles sont imbriqu?es, on peut d?cider de les nommer ? l'aide du symbole ":".

Exemple

// on parcourt tous les elements d'une matrice
// carree a la recherche d'une valeur

int x,y;
ext : for (x = 0;x < tab.length) {
    for (y = 0;y < tab[0].length) {
        if (tab[x][y] == recherche)
            break ext;
    }
}
System.out.println("la position recherchee est "+x+","+y);
throw et try. Le traitement des exceptions fait usage de throw et de try. Vous pouvez vous reporter ? la page concernant les exceptions en g?n?ral ou ? la page pr?vue pour la clause try.

Le mot cl? synchronized est d?crit en d?tail ? la page consacr?e ? l'exclusion mutuelle.


Index g?n?ral - Index concepts - R?gles BNF
? 1996, DIP Gen?ve, Alexandre Maret & Jacques Guyot
page g?n?r?e Fri Jun 21 15:41:10 MET DST 1996
------MultipartBoundary--bLtEvulYAWPPvGwCBOxlmk306EbXaXT4LKa8DpPjHY---- Content-Type: image/gif Content-Transfer-Encoding: binary Content-Location: http://cui.unige.ch/isi/bnf/JAVAF/statement.gif GIF89ap????!?,p?????????ڋ?޼???H?扦?ʶ? ??L???????? ?Ģ?L*?̦? ?J?Ԫ??M[P7 ?Ǥ/??A????:??q9?~??r?w?(8??G?h????x??)IHYi)8?????ؙ?x9JZZ???'??)?j+;땩h???w?I,N^n~???????^Q/?O_o???????d?X?? $v??B ?40?pA?IXQ??0? ???$^???c??K?????'3,??e+??L?Z?T5SU.]?\????!??D?=?4?Rz??Ly?T?Q???s*?}T.? 6?رF5?l???UX?? ?[??B????ge?M?R??2??p-,????,?V??upo}?????Vs?D???W?h?@??G>$!N???/~?5>|???k?????9?؀???BZ???@.h???a?}?Մ????a~???al???b?*??U^-*?^ ???`??b?:?x??&B?K4 ? 4?Ԗdsa݁B???8U???(??U???Ft? ??C>??3?@?l??pb^>??Dmn ?fj6??w~?ń{?YŸ???c?1??堎RA磒B餖.Q饚?){?~*$~??؆?ߌ*??-(????I?e?9??1Y???Wk?:?????g?Yhچ???)??=-Z???N??? F???n??W?U?S?Z7$?T??m???c??)؋?W??K?Q?-+H??(?Z???]??$gy??i????jQK/?Xzv#k?n"?6?*?F??l|l?????";????8򏛾L?0ό??4?{?D??̨F???ʵ [{?z ??O??𯱒K5?@?{????h??5m?a? ?is^??@?Mw???i????]u? 8?^??'?u???]??G?s???{?غ,|??ka|??_g??λ???=?I71??MW??z[??}X????OMU????g??:#?ʏ??l??|p?????:??E?I??8ӷry%? ????T? )04??[ļ???z?s ??ØY??[_?8???H,t?yl.h:? e?K]?? ? 걭?(? cL??f?u?/T?r?? ?O??[#WW???[?[?_B̹?L 1???+?5????wê_3?7??p0?ˎ??S?/Y?lg??9?ܫ3???????????S?"ͭ?.?_-R?O?=????*R4{O?i??Xy?qn^??4?R???uTE=Auד'??@Ga??Y?? S&?c?=V#?ԗٵ??F ?vǤ???\Z?0)7?YZ?g???U? ?T?,???#vv?۬?c?X?خ (???ԎKD/]! V1?y?/?]lD??kP?&?w??/ՠ?h?ё????~??'oӚ?;V??^S???s?y???U?/?,??3???3??)sj?8–?=`n?몺?>??ɇx?L??lz??=?????j?????(??~????{6@ٗHgK????Y}5?c? ]????M~???#?5????veW?XW?G}~fHk??~??Ɂ5?7j5G_8,?wH??)??l??xʗE?^0??? {?$?x?y?"???'??)?KXD?8)?shŇ?4?g?i?0Hf?O?? ?O?y ??t?6?ؒ?)& ?ڦ??v???|?? ??pG??B?%5oL?q?e?B?Xp??}֚@#?E~??!c'IP?tS8\??6? 0?u????h????~>?q֗?i9??S$G??Ҕ{ňXVT2WcIV+\Go1?u`C??Bg??3???g?㙘hi?TH???;ȟ??kQ?9?????1?Iy?&????۵? 3qi????L???z?7???h?Jsi???֓?ؖ??{h?JM4??W?3??y??%??? ??h????G?<)?՛???l?Ҥ?ؤ鲣??_צh??u?I???&j?FZ??Uh??#??n???YRJik[w?&??乚/?????v*?ӢzC"??? ?b?v'?rz??Z???i??r??t?`?Ulv??E)o??8????]????8?????h?W٦???n٣Ty?: ?5???? ???~??6???*D???{?ڀ$??=?.??|? H?V?????ԏ?)sٺZ???,h?qA??i0P??????z????L֫G:+????e?)???r?(??Z?մ??z?jv???t???נ?????ʰE??+T?*??*??I?7?L??а???????J??k!??(ۉǨz??*?????$ ?@?r?j????z??m]??=????:[FC;lU?(?Dce????L??*n+?׸??4+H?kz'k???x??bK?JA??=ȳ?+?Ԑ#?ʣ? ?+;??:?1??Kx?=??뵢[?Z٩?z??*???? ?? ۷7???:? {??:??{?{??[???f??????Y??*????[???a\??e?m3??ۻX*I2Y?鴻io3h????''0?Z?ȉf?{?ԹS?????Z???֙?ś?۬?+??{?ۡ?K?????{??ڿ?K34? \??;?\? +?\? ?\?{D?jblIE???۶z?}ʯ??M? h?¼???O??$8?5X?i?@????`??;K???r??G?:X*?)T? "Ĝ???K? ?b?5*?`?&xf̧ @???@R?p?*`??\?>??6??? 2g?j?Aa?i?*P??q֞\?[y,ә?;>?@[˰??%0??d?z]?m?ٳ?1?n?[???(??4n??#?}۶???F??N?uu?c?:B???u?O?k??՟b?,t??????]x????}??T?@Q??E???oyQW?~?=8ԇ5aR??U ? jH?~?@?? ?8?|;?%]?J-ؠERp?!?xщ7??㊀y?????c?E}??E??]zPA??Dq??QOF??s???k?a??[RF??NF?"??Mf?p ????/?ǥ?y?I?d?h%?J??Wl???Q?F@g}_)??i????????DPh? >??h=????r6*?L?z`?w6??.??P?2 ??Z'??ڪ?U?^*?KMi?g??@?? ??E?.?뫱?j?????ժ?&{??@V???ފm??n?-?U?k?^n?S???z(僻??+??ݛ?e?~hm? ?+??L*?5#?????.?:??W?b?g|.??J m?")&???1???ē??Y??ږ??C???Bi??/????y?%R?????={????f???AR?(K?r?o?e??R??u??>&,?`"em?i{ ??X?JF??A?@?t?VY?Q?SE`??]g ?}d?S%?8ƽB?DBQ?`???װF?E~??ߗ? 6????Qy???V?o?G?>T?j?C????F?/?????n?Aȗ7T_???C??\Q??{OQF; ------MultipartBoundary--bLtEvulYAWPPvGwCBOxlmk306EbXaXT4LKa8DpPjHY---- Content-Type: image/gif Content-Transfer-Encoding: binary Content-Location: http://cui.unige.ch/isi/bnf/JAVAF/images/code.gif GIF89a! ?????????????????????U?44??R??$O?R fؒ?O~????-H? 6 O6F??6Bl6??6 2???? OF?Ze?? O ??  d??e?Fo?????D??O?Dl??&lh????? -????D0/? ??@-?0/?P1B?1?6???(_D??-?"?1??G???0/ς?(??g??q?/?NI??)7 0/ ?  ?? )7@0/0/tnuelt? j????G??p??(?,???T}????h/?,?????p????????G??<??p??????G?D$????(&??y??0/$?,)7/?@/r?/0/Ir???A?0?0/uq?titdeD?5?????[??lq??(??D"??6 %??(??t? ?ߟ?ߟ???_???????????????????_?????????????????_?__?_??_??_??_??_???_?????????????_??????????ߟ???????_??????????߿?????߿_߿߿?߿?߿?߿??𠠤???????????????!??,! ?? H??A? \??`? ??o?D|??x0?ǁP???@ƍ?/?NJ!G?




© 2015 - 2024 Weber Informatics LLC | Privacy Policy