Time remaining:
Please help me and tell me whats wrong with this array

Computer Science
Tutor: None Selected Time limit: 1 Day

public class Array1 {

public static int[] copyArray(int[] anArray){

int temp[] = new int[anArray.length];

temp = anArray;

return temp;

}

}

Apr 10th, 2015

hey check this code....there is no problem in this array... its working fine..!!

public class Array1 {

    //Please help me and tell me whats wrong with this array

public static int[] copyArray(int[] anArray){

    int temp[] = new int[anArray.length];

    temp = anArray;

    return temp;

}

public static void main(String args[]){

    Array1 o1 = new Array1();

    int data[] = new int[] {10,20,30,40,50,60,70,80,90,100 };

    int data1[] = new int[10];

    data1 = o1.copyArray(data);

     for(int i = 0; i<10;i++){

         System.out.println(data1[i]);

     }

   }

}


Apr 10th, 2015

Did you know? You can earn $20 for every friend you invite to Studypool!
Click here to
Refer a Friend
...
Apr 10th, 2015
...
Apr 10th, 2015
Dec 3rd, 2016
check_circle
Mark as Final Answer
check_circle
Unmark as Final Answer
check_circle
Final Answer

Secure Information

Content will be erased after question is completed.

check_circle
Final Answer