Java_32 创建数组的三种方法
//定义数组的三种方法
package my;
public class _46创建数组的3中方法 {
public static void main(String[] args)
{
//方法1(常用)
int[] meth1 = {1,2,3,4,5,6};
//方法二
int[] meth2 = new int[6];
meth2[0] = 1;
meth2[1] = 2;
meth2[2] = 3;
meth2[3] = 4;
meth2[4] = 5;
meth2[5] = 6;
//方法三(不经常用)
int meth3[] = new int[]{1,2,3,4,5,6};
}
}