Created
October 6, 2016 06:30
-
-
Save beta/2f015f50e59617ee166b5415ad3d18d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Find the Java class of ArrayList | |
jclass arrayListClass = (*env).FindClass(“java/util/ArrayList”); | |
// Create an instance by finding the method ID of the constructor | |
jobject arrayList = (*env).NewObject(arrayListClass, (*env).GetMethodID(arrayListClass, “<init>”, “()V”)); | |
// Find the class of float | |
jclass floatClass = env->FindClass(“F”); | |
// Let’s assume a float array contains 10 elements | |
jsize size = 10; | |
// Create arrays | |
jobjectArray array1 = env->NewObjectArray(size, floatClass, NULL); | |
jobjectArray array2 = env->NewObjectArray(size, floatClass, NULL); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment