Java System arraycopy() MethodThe arraycopy() method of Java System class returns or copies a subsequence components of a specified source array, begins at a specified position(referred as"srcPos") of source array(referred as "src") to the specified position(referred as "destPos") of destination array (referred as "dest"). The "length" argument is for number of components to be copied. SyntaxParameterssrc - Source array (Object type) srcPos - Starting position in Source array (Integer type) dest - Destination array (Object Type) destpos - Starting position in destination array (Integer type) length - Number of elements to be copied (Integer type) Returns
Example 1Output: Source array:1234321 Destination array:5678765 Source Position:1 Destination Position:2 Length:4 Destination array after use of arraycopy() 5623435 Example 2Output: Source array:ABBHAM Destination array:SHUNUL Source Position:2 Destination Position:3 Length:4 Destination array after use of arraycopy() SHUBHAMJADON Next TopicJava-system-clearproperty-method |