数组copy类:
public class TestArrayCopy{ public static void main(String[] args){ String[] s={"Microsoft","Apple","Google","Baidu"}; String[] sbak=new String[6]; System.arraycopy(s,0,sbak,0,s.length); int i=0; while(sbak[i]!=null){ System.out.print(sbak[i]+" "); i++; } } }
时间: 2024-12-12 20:29:29