声明一个数组
int[] age;
int ages[];  //这种方式不推荐
age = new int[28];  
命名了28个int空间,并且每个空间初始化为0;new
new强制初始化数组,数组里面全初始化为0
定义数组的方式
double[] grade = new double[28];
grade2[0] = 90;  //[index]index是索引
String[] str = new String[10];
Sting如果没有初始化,默认是null
数组的复制
    String[] studentcopy = new String[5];
    for(int k =0;k<student.length;k++){
        studentcopy[k] = student[k];}
arraycopy 进行数组的复制
    System.arraycopy(student, 0, studentcopy, 1, student.length-1);  
    System.out.print(studentcopy[2]);
    for(int l=0;l<5;l++){
        System.out.println(studentcopy[l]);}
方法
System.arraycopy(arg0, arg1, arg2, arg3, length);
第一个arg0表示旧的数组,arg1copy的起始位置,arg2新的数组,arg3copy到新数组的位置,arg4数组的长度
原文:http://www.cnblogs.com/yeruheqi/p/5335475.html