class
apples{
public
static
void
main(String args[]){
int
counter = 0;
while
(counter < 10){ →
這是這個while循環的條件
System.out.println(counter);
counter++; →
如果符合條件會做什麼
}
}
}
如果counter是小於10,他們將繼續下去,直到它不符合這個條件,所以這個Program的結果會這樣:
0
1
2
3
4
5
6
7
8
9
沒有留言:
張貼留言