JNI FindClass格式的子类? [英] JNI FindClass format for subclasses?

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

问题描述

加载子类的正确FindClass标识语法是什么?例如:

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

package a.b.c;

class Foo {
   class Bar {
     ...
   }
}

要获得 Foo 我可以(* env) - > FindClass(env, / a / b / c / Foo),但试图通过(* env)获取 Bar - > ; FindClass(env,a / b / c / Foo / Bar)抛出 ClassNotFoundException 。是否有不同的语法来表示子类?

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?

推荐答案

没关系, javap 工具在这里证明有用。正确的语法是:

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

a / b / c / Foo $ Bar

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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆