package cn.bit;
import java.util.Arrays;
public class TestArrayAll {
//写一个方法, 将数组中的每个元素都 * 2
public static void printArray(int[] array){
for (int i = 0; i < array.length; i++) {
System.out.print(array[i]+" ");
}
System.out.println();
}
public static void transform(int[] arr){
for (int i = 0; i < arr.length; i++) {
arr[i] = arr[i] * 2;
System.out.print(arr[i]+" ");
}
}
//实现自己版本的copyArray
public static void copyArray(int[] array1,int[] array2){
for (int i = 0; i < array1.length; i++) {
array2[i] = array1[i];
}
}
//自己实现toString方法
public static String toString(int[] array){
String result = "[";
for (int i = 0; i < array.length; i++) {
result = result + array[i];
if (i != array.length-1){
res