1. 程序中从屏幕获取输入。
Scanner sc = new Scanner(System.in);
sc.nextDouble(); //获取从屏幕输入的数据
2. 创建数组
int [] a,b;
int a[] = new int[5];//new 作用:在内存中开辟空间
3. 各种数组类型默认初始化值
int: 0
char:
float: 0.0
double: 0.0
String: null
4. 数组拷贝
使array1 与array2 指向同一数组
array1 = array2
5. arraycopy 函数
System.arraycopy(array1,fromindex,array2,toindex,length)
6. 如何打印数组内容
方法1:for 语句
方法2: for(数组类型 变量名:数组名)
7. 会用copyarray函数和 for语句实现数组的拷贝和打印
int a[] = {1,2,3,4,5};
int b[] = {6,7,8,9,10,11,12};
System.arraycopy(a, 0,b, 2, 3);
for(int x:b)
{
System.out.println(x);
}