第1个回答 推荐于2017-09-11
String[] strings = {"你好", "哈哈", "江山", "美人"};
for(String str:strings){
System.out.println(str);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
}本回答被提问者采纳
第2个回答 2012-03-15
public class fors {
public static void main(String[] args) {
String[] strings = {"你好", "哈哈", "江山", "美人"};
for(String string : strings){
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
System.out.print(string);
}
}
}
第3个回答 2012-03-15
public class TestCirculation {
public static void main(String[] args) {
String[] string = { "你好", "哈哈", "江山", "美人" };
for (int i = 0; i < string.length; i++) {
System.out.println(string[i]);
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
}
第4个回答 2015-09-28
int[] i = 自己定义的数组;
for(int i=0;true;i++){
System.out.println(i[i%i.length]);
}