tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 
 Tools and Libs > Ostermiller Utilities > Concat Arrays

Concat Arrays 

Ostermiller Java Utilities contain various components such as CSV parsing, Base64 Encoding, MD5 digest, String and Exec Helper classes. This requires the library ostermillerutils-1.08.01.jar to be in classpath. The following example shows concatenating two arrays.

File Name  :  
com/bethecoder/tutorials/ostermillerutils/ConcatArrayTest.java 
Author  :  Sudhakar KV
Email  :  kvenkatasudhakar@gmail.com
   
package com.bethecoder.tutorials.ostermillerutils;

import java.util.Arrays;

import com.Ostermiller.util.ArrayHelper;

public class ConcatArrayTest {

  /**
   @param args
   */
  public static void main(String[] args) {

    Integer [] one = new Integer [] { 24};
    Integer [] two = new Integer [] { 13};
    
    Integer [] three = (Integer []) ArrayHelper.cat(one, two);
    System.out.println(Arrays.toString(three));
    
    
    String [] a = new String [] { "ONE""TWO" };
    String [] b = new String [] { "THREE""FOUR" };
    
    String [] c = (String []) ArrayHelper.cat(a, b);
    System.out.println(Arrays.toString(c));
  }

}
   

It gives the following output,
[2, 4, 6, 1, 3, 7]
[ONE, TWO, THREE, FOUR]


                    Print

   



Books Recommendation

 
 
bl  br