While and do while


Source code

1class WhileAndDoWhile {
2
3 int mWhile(int inputParam) {
4 while (inputParam < 100) {
5 inputParam += 1;
6 }
7 return inputParam;
8 }
9
10 int mDoWhile(int inputParam) {
11 do {
12 inputParam += 1;
13 } while (inputParam < 100);
14 return inputParam;
15 }
16
17}

Bytecode



Java compiler version: 21
Other examples
Main page