package e_6;
public class EL_4 {
public static void main(String[] args) {
int[] list1={1,2,3,4,5,6,7,8,9,0};
System.out.print("调用reversInSameArray前,list1:");
outputArray(list1);
reverseInSameArray(list1);
System.out.print("调用reversInSameArray后,list1:");
outputArray(list1);
int[]list2={1,2,3,4,5,6,7,8,9,0};
int[]list3=null;
System.out.print("调用reversInSameArray前,list1:");
outputArray(list2);
list3=reverseInNewArray(list2);
System.out.print("调用reversInSameArray后,list2:");
outputArray(list2);
System.out.print("调用reversInSameArray后,list3:");
outputArray(list3);
}
public static void outputArray(int[]array){
for(int value:array){
System.out.print(value+" ");
}
System.out.println();
}
public static void reverseInSameArray(int[]array){
for(int i=0,j=array.length-1;i
资源文件列表:
Java 动物医学3班陈泽祈(202320110302).zip 大约有125个文件