Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Array concat two arrays in java

public static void main(String[] args) {

// for each ile cozumu
        String[] arr3 = {"A", "B", "C","Z","N"};
        String[] arr4 = {"D", "E", "F","G","U"};

ArrayList<String> list1 = new ArrayList<>(); //[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]
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Array #concat #arrays #java
ADD COMMENT
Topic
Name
4+9 =