且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 clojure 中调用 java 静态方法?

更新时间:2023-10-06 12:49:40

您可以使用 (ClassName/methodName arguments) 调用静态方法.

You can call a static method using (ClassName/methodName arguments).

然而 class 不是静态方法,它是一个 java 关键字,在 clojure 中不需要它.要获取与 String 类关联的 Class 对象,只需使用 String.

However class is not a static method, it's a java keyword and you don't need it in clojure. To get the Class object associated with the String class, just use String.