子类的 JNI FindClass 格式?

JNI FindClass format for subclasses?(子类的 JNI FindClass 格式?)

本文介绍了子类的 JNI FindClass 格式?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

What is the correct FindClass identifier syntax to load subclasses? For example:

package a.b.c;

class Foo {
   class Bar {
     ...
   }
}

To get Foo I can do (*env)->FindClass(env, "/a/b/c/Foo"), but trying to get Bar through (*env)->FindClass(env, "a/b/c/Foo/Bar") throws a ClassNotFoundException. Is there a different syntax for representing subclasses?

解决方案

Never mind, the javap tool proved helpful here. The correct syntax is:

a/b/c/Foo$Bar

这篇关于子类的 JNI FindClass 格式?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本文标题为:子类的 JNI FindClass 格式?

基础教程推荐