In java native interface provided
jclass class = (*env)->FindClass(env,"ClassName");
and
jclass class = (*env)->GetObjectClass(env,"ClassName");
I would like to know difference between this two methods and how it find a class by using class name and what kind of situations it can be null.
解决方案
GetObjectClass allows you to retrieve the class for an object, not knowing the class name. The second argument to GetObjectClass is a jobject, not a class name.
On the other hand, FindClass gives you a class reference if you can specify the class name.
So the result of both function gives the class reference. The difference is the input (argument) to each methods.