public static void arraycopy(Object src, int srcPos,Object dest, int destpos, int length)
here src object specify from where array is to be copied whereas dest object specify where to be copied.And int src specify starting postion of array and int destpos specify starting index of destination array int length shows length of character to be copied.
CODING:
class arraycopy
{
public static void main(String args[])
{
char[] From = { 'd', 'j', 'a', 'v', 'a', 'e',
'i', 'n', 'a' };
char[] To = new char[7];
System.arraycopy(From, 1, To, 0, 4);
System.out.println(new String(To));
}
}
No comments:
Post a Comment