Basta ya de buscar por todo internet porque has llegado al lugar correcto, poseemos la respuesta que buscas sin problemas.
Ejemplo 1: concatenar dos matrices en java
importjava.util.Arrays;publicclassConcatpublicstaticvoidmain(String[] args)int[] array1 =1,2,3;int[] array2 =4,5,6;int aLen = array1.length;int bLen = array2.length;int[] result =newint[aLen + bLen];System.arraycopy(array1,0, result,0, aLen);System.arraycopy(array2,0, result, aLen, bLen);System.out.println(Arrays.toString(result));
Ejemplo 2: matriz concat dos matrices en java
publicstaticvoidmain(String[] args)// for each ile cozumuString[] arr3 ="A","B","C","Z","N";String[] arr4 ="D","E","F","G","U";ArrayList<String> list1 =newArrayList<>();//[A, B, C, Z, N, D, E, F, G, U]for(String each: arr3 )
list1.add( each );for(String each1 : arr4 )
list1.add(each1);System.out.println(list1);// [A, B, C, Z, N, D, E, F, G, U]
Ejemplo 3: combinar dos array en java
publicstaticvoidmain(String[] args)// for each ile cozumuString[] arr3 ="A","B","C","Z","N";String[] arr4 ="D","E","F","G","U";ArrayList<String> list1 =newArrayList<>();//[A, B, C, Z, N, D, E, F, G, U]for(String each: arr3 )
list1.add( each );for(String each1 : arr4 )
list1.add(each1);System.out.println(list1);// [A, B, C, Z, N, D, E, F, G, U]
Reseñas y puntuaciones de la guía
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)