Created
December 8, 2014 00:34
-
-
Save OlgaKulikova/8caa38b08641a8dfa7c0 to your computer and use it in GitHub Desktop.
module1.lesson4.task4
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
package module1.lesson4.task4; | |
/* | |
Написать ф-ю для объединения 2-х массивов в один. Вывести результат на консоль. | |
*/ | |
import java.util.Arrays; | |
public class Main { | |
public static void main(String[] args) { | |
String[] arr1 = new String[] {"one", "two", "three"}; | |
String[] arr2 = new String[] {"four", "five", "six"}; | |
String[] arrRes = new String[arr1.length + arr2.length]; | |
System.arraycopy(arr1, 0, arrRes, 0, arr1.length); | |
System.arraycopy(arr2, 0, arrRes, arr1.length, arr2.length); | |
System.out.println(Arrays.toString(arrRes)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment