无法调用类成员变量 #110
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
kotlin 代码如下:
输出结果:
nil
调用 Kotlin 方法
为什么输出 Test 类中成员 name 为 nil ????????
You should first bind the Java class in the Lua file with full class name .
If you use Kotlin, maybe you should bind classes with
TestKtinstead ofTest.More examples : Click me
You don't seem to see my question clearly. I asked why the calling class member variable is nil
If you want to use
Test.namein Lua, you may need to add@JvmFieldto the field ( btw :getName()is better ).If you decompile the bytecode, you will see that the field is compiled as private.