简体   繁体   English

从jruby访问Java类中的静态字段

[英]Accessing static field in Java class from jruby

In java class Bytes I have: 在java类字节中,我有:

public final static Comparator<byte []> BYTES_COMPARATOR = new ByteArrayComparator();

From ruby, how can I access the above field ? 从ruby,我如何访问上述字段? I tried 我试过了

Bytes:BYTES_COMPARATOR
Bytes.BYTES_COMPARATOR

Neither of the above worked. 以上两种都不起作用。

Hint is appreciated 提示被赞赏

Try this instead: 尝试以下方法:

Bytes::BYTES_COMPARATOR

Assuming you imported Bytes 假设您导入了Bytes

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM