Reputation: 63542
If I want to instantiate a Date
, I can use:
jclass cls = (*env)->FindClass(env, "java/util/Date");
jmethodID ctr = (*env)->GetMethodID(env, cls, "<init>", "()V");
jobject obj = (*env)->NewObject(env, cls, ctr);
But how do I instantiate an ArrayList<String>
?
Upvotes: 10
Views: 3224
Reputation: 897
@noise is correct. Generics are used simply to ensure type safety. When compiled, the compiler does "type erasure". Check out this more detailed explanation of type erasure: Type Erasure
Upvotes: 7