Copy an Array in reverse order
public class copyAnArrayInreverseOrder{ public static void main(String args[]){ int [] source={1,2,3,4,5,6,7,8,9,10}; int [] destination=new int[source.length]; for(int i=0;i < destination.length;i++) { destination[i]=source[source.length-1-i]; System.out.println(destination[i]); } }}
No comments:
Post a Comment