Creating and Passing Arrays of Objects

You can create an object array as shown here:

CALL "C$JAVA" USING CJAVA-CREATEARRAY, CJAVA-OBJECTARRAY, 10 GIVING ARRAY-HANDLE.

In this case, the array consists of an array of object handles. Here is an example of calling a Java method that takes an array of objects:

CALL "C$JAVA" USING CJAVA-CALL, OBJECT-HANDLE, "acuCobolGT/CAcuCobol", "CobolCallingJavaObjectArray", "([Ljava/lang/Object;)X", ARRAY-HANDLE, FIELD-STRINGRET GIVING STATUS-VAL.