public class Demo2{
public static void main(String[] args){
for(int i=0;i<5;i++){
System.out.println("HelloWorld");
}
System.out.println("---------");
int j=0;
while(j<5){
System.out.println("HelloWorld");
j++;
}
System.out.println("---------");
int k=0;
do{
System.out.println("HelloWorld");
k++;
}while(k<5);
}
}
结果展示: