public final static String[] polyLineColor={"#0","#1","#2","#3","#4","#5","#6"};
public static void main(String[] args) {
for(int i = 0 ; i < 20 ; i++) {
int aa = i % polyLineColor.length;
System.out.println(polyLineColor[aa]);
}
}
這樣可以有以下顯示的結果
#0
#1
#2
#3
#4
#5
#6
#0
#1
#2
#3
#4
#5
#6
#0
#1
#2
#3
#4
#5