All array types have a clone method that is public, not protected. You can use it to make a new array that contains copies of all elements. For examples
int[] luckyNumbers={2,3,5,6,4,11};
int[] cloned = lickyNumbers.clone();
All array types have a clone method that is public, not protected. You can use it to make a new array that contains copies of all elements. For examples
int[] luckyNumbers={2,3,5,6,4,11};
int[] cloned = lickyNumbers.clone();