while(<boolean condition>){
<Block of statements>;
}
Contoh penggunaannya adalah sebagai berikut :
public class SimpleWhileLoopExample {
public static void main(String[] args) {
int i = 0;
while(i <= 5) {
System.out.println("i is : " + i);
i++;
}
}
}
Selamat mencoba, semoga membantu.
1 comments - Add Yours
I am extremely impressed along with your writing abilities, Thanks for this great share.
Posting Komentar