SL-275(五):數(shù)組
1。使用增強(qiáng)的for循環(huán)(jdk1.5)
int[] list=new int[3];//此時list數(shù)組已經(jīng)初始化,每個元素為0;
for(int element:list)
{
???System.out.println(element);
}
Console:
0
0
0
上述的for語句等價于:
for(int i=0;i<list.length;i++)
{
???????System.out.println(list[i]);
}
2。數(shù)組的復(fù)制
使用System.arraycopy(...)函數(shù);
posted on 2006-10-02 19:35 小雨不打傘 閱讀(228) 評論(0) 編輯 收藏 所屬分類: SL-275學(xué)習(xí)筆記