如何将 JRuby 中的方法调用到我的 Java 代码中?
现在我的 Ruby 脚本代码中有一个方法,基本上它返回一个变量,这个变量对我的 java 代码非常重要,所以我在 java 代码中想要的是调用 Ruby 脚本和脚本中的这个方法返回一个值,该值应分配给我拥有的变量..
这是我在ruby中的代码..我想在java中调用它并使用它返回的内容并将其放入变量中..
def numberMethod
number = 3
return number
end
如果你知道我在哪里可以读到相关内容或者如果您知道如何解决,请给我评论或回答!
谢谢!
Now i have a method in my Ruby script code and basicaly its returning a variable and this variable is pretty important to my code in java, So what i whant in my java code is to call this method that is in the Ruby script and the script returns a value and this value shall be assigned to my variable that i have..
Here is the code i have in ruby.. And i whant to call it in java and use what it returns and put it in a variable ..
def numberMethod
number = 3
return number
end
If you know where i can read about it or if you know how to solve it please give me a comment or answear!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试阅读 RedBridge
try reading RedBridge