Results 1 to 1 of 1
- 10-10-2010, 06:59 PM #1
Member
- Join Date
- Oct 2010
- Posts
- 4
- Rep Power
- 0
copy arrays without using arraycopy Method !
Hi guys ;
Question :-
Study the specification of the arraycopy method in the System class, and then write a
short program that uses the arraycopy method to copy all the elements of an array to
another array. Output the elements in the destination array to make sure the copying
actually occurred.
this is my code :-
Help me plzzz , :)PHP Code:public static Object arraycopy(Object src, int srcPos,Object dest, int destPos, int length) { Object[] srcArray=(Object[]) src; Object[] destArray=(Object[]) dest; for(int i=srcPos;i<srcPos+length;i++){ destArray[i]=srcArray[i]; } return destArray[i];// cant see srcArray cuz it out of for loop ! what is the solution?? }
Similar Threads
-
Arrays.sort... why sorting all arrays in class?
By innspiron in forum New To JavaReplies: 6Last Post: 03-23-2010, 01:40 AM -
method overloading and arrays.
By glopez09 in forum New To JavaReplies: 5Last Post: 12-08-2009, 03:02 PM -
How to copy a polygon
By cassysumandak in forum New To JavaReplies: 6Last Post: 10-07-2009, 12:37 AM -
Deep copy?!
By deepthought015 in forum New To JavaReplies: 3Last Post: 05-07-2009, 06:31 PM -
add method in arrays
By MuslimCoder in forum New To JavaReplies: 1Last Post: 03-14-2009, 11:58 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks