河南成教 / Java程序设计
public class AA
{
static public void main(String args[])
{
int firstArray[]={1,2,3,4};
int secondArray[]={5,6,7,8,9,10};
int myArray[];
myArray=firstArray;
System.out.println("First Array:");
for(int index=0;index<myArray.length;index++) {
System.out.println(myArray[index]);
}
myArray=secondArray;
System.out.println("Second Array:");
for(int index=0;index<myArray.length;index++) {
System.out.println(myArray[index]);
}
}
}
{
static public void main(String args[])
{
int firstArray[]={1,2,3,4};
int secondArray[]={5,6,7,8,9,10};
int myArray[];
myArray=firstArray;
System.out.println("First Array:");
for(int index=0;index<myArray.length;index++) {
System.out.println(myArray[index]);
}
myArray=secondArray;
System.out.println("Second Array:");
for(int index=0;index<myArray.length;index++) {
System.out.println(myArray[index]);
}
}
}
参考答案:
佳题速递: