Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

Concatenate two arrays java

//USing Apache Commons Lang library.
int[] both = ArrayUtils.addAll(first, second);
Comment

combine two array 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]
    }
Comment

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]
    }
Comment

how to merge two arrays in java

    public static void main(String[] args) {

        int[] x = {1, 2, 3};
        int[] y = {4, 5, 6};
        int[] merge = new int[x.length + y.length];

        for (int i = 0; i < x.length; i++) {
            merge[i] += x[i];
        }

        for (int i = 0; i < y.length; i++) {
            merge[x.length + i] += y[i];
        }

        System.out.println(Arrays.toString(merge));
    }
Comment

PREVIOUS NEXT
Code Example
Java :: convert java to c# 
Java :: checkc if string is double java 
Java :: Program to remove duplicates in an ArrayList 
Java :: sublist java 
Java :: JsonArray get first Object 
Java :: change status bar text color android programmatically 
Java :: recursion examples java 
Java :: multiple condition inside for loop java 
Java :: copying primitive array to arraylist in java 
Java :: delet file from path android 
Java :: get array element java 
Java :: java map create with values 
Java :: android dialogfragment fullscreen stack overflow 
Java :: fibonacci series in java 
Java :: Java Regex : 4 Letters followed by 2 Integers 
Java :: java create xml 
Java :: comparacion de strings java 
Java :: set matrix zeros programming creek 
Java :: java use variables inside strings 
Java :: Java The Throw/Throws Keyword 
Java :: main method in java 
Java :: open new fragment from fragment 
Java :: queue.isempty java 
Java :: input using stringbuffer 
Java :: how to convert errorBody to pojo in retrofit 
Java :: android get device hieght 
Java :: java print a line seperate by space 
Java :: overload and override in java 
Java :: what are parameters in java 
Java :: springbootservletinitializer maven dependency 
ADD CONTENT
Topic
Content
Source link
Name
2+4 =