Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to compare string in jni?

jhovarieJul 3 2012 — edited Jul 10 2012
Hello guys dont know tho to compare string in jni whats wrong in this code?
jstring jstr1 = (*env)->NewStringUTF(env,"Hello");  
    jstring jstr2 = (*env)->NewStringUTF(env,"Hello"); 
    if(jstr1 == jstr2){ //Im trying to compare string in JNI
     printf("Thesame\n");
    }else{
     printf("Not Thesame\n");
    } 
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2012
Added on Jul 3 2012
7 comments
2,252 views