Sample code for 30+ languages & platforms
Java

AppendArrayItems Example

Demonstrates the AppendArrayItems function.

Note: This example requires Chilkat v9.5.0.82 or above.

Chilkat Java Downloads

Java
import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    CkJsonArray jarr1 = new CkJsonArray();
    jarr1.Load("[ 1, 2, 3, 4]");

    CkJsonArray jarr2 = new CkJsonArray();
    jarr2.Load("[ 5, 6, 7, 8]");

    jarr1.AppendArrayItems(jarr2);

    System.out.println(jarr1.emit());
    //  Expected output: [1,2,3,4,5,6,7,8]

    System.out.println(jarr2.emit());
    //  Expected output: [5,6,7,8]
  }
}