-
-
Save parzibyte/d5089087f8cf82232408e7fe502c374b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
int[] numeros = { 10, 50, 12, 55 }; | |
// Alojar espacio | |
int[] copiaDeNumeros = new int[numeros.length]; | |
// Clonar | |
System.arraycopy(numeros, 0, copiaDeNumeros, 0, numeros.length); | |
// Imprimir para demostrar que tienen los mismos elementos | |
for (int i = 0; i < numeros.length; i++) { | |
System.out.printf("Dentro de arreglo 1 en la posición %d existe %d y en el arreglo 2 existe %d\n", i, | |
numeros[i], copiaDeNumeros[i]); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment