☆★Java質問・相談スレッド177★★at TECH
☆★Java質問・相談スレッド177★★ - 暇つぶし2ch828:デフォルトの名無しさん
16/06/05 19:14:01.58 /bruxSbe.net
>>824
14.16. The continue Statement
URLリンク(docs.oracle.com)
| The scope of a label of a labeled statement is the immediately contained Statement.
| The continue target must be a while, do, or for statement, or a compile-time error occurs.

ラベルのスコープはラベル直後のステートメント
continueの対象はwhile, do, forに限る


ちゅうことなんでラベルは貼れても飛ぶことができないかと
こういうのだったらできるんだけどねー

int i = 0;
Label_1: while (i < 3) {
 Label_2: while (true) {
  if (i % 2 == 0) {
   i++;
   continue Label_1;
  } else {
   i++;
   continue Label_2;
  }
 }
}


次ページ
続きを表示
1を表示
最新レス表示
レスジャンプ
類似スレ一覧
スレッドの検索
話題のニュース
おまかせリスト
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch