No Results
Search Tips:
- Please consider misspellings
- Try different search keywords
Newer Version Available
Do-While ループ
Apex do-while ループは、特定の Boolean 条件が true である限り、コードのブロックを繰り返し実行します。構文は次のとおりです。
1do {
2 code_block
3} while (condition);Java の場合と同様、Apex do-while ループは、最初のループが実行されるまで、Boolean 条件ステートメントをチェックしません。そのため、コードブロックは必ず少なくとも 1 回は実行されます。
次のコード例は、1 から 10 の数値をデバッグログに出力します。
1Integer count = 1;
2
3do {
4 System.debug(count);
5 count++;
6} while (count < 11);