I have Java class:
class SomeClass{
private int i;
public SomeClass(int i){
this.i = i;
}
}
And I need to create instance of this class in Lua script and pass it to Java function, using LuaJ library. How I can do it?
I have Java class:
class SomeClass{
private int i;
public SomeClass(int i){
this.i = i;
}
}
And I need to create instance of this class in Lua script and pass it to Java function, using LuaJ library. How I can do it?
Copyright © 2021 Jogjafile Inc.
This is some example code found on lua.org:
source: http://www.luaj.org/luaj/3.0/README.html#luajava
With your example, this should translate to:
If you have a method
public int getValue()
, you can useobj:getValue()
.I've tested this myself just now, as I hadn't for a long time.