public class ArrayCopy
{
public static void main(String []args)
{
int arr[]=new int[]{1,2,3,4,5,6,7,8,9,10};
for(int i:arr)
{
System.out.print(i);
}
int arr1[]=new int[10];
System.arraycopy(arr,5,arr1,0,5);
for(int i:arr1)
{
System.out.println(i);
}
}
}
0 comments:
Post a Comment