- for循环
publicclassTestFor{
publicstaticvoid main(String args[]){
for(int i =0; i < 10; i++){
System.out.println(i);
}
}
}
- whlie循环
publicclassTestWhile{
publicstaticvoid main(String args[]){
int i =0;
while(i <10){
System.out.println(i);
i++;
}
}
}
时间: 2024-10-06 17:49:28