How can I call a java static method in clojure?
Solution 1:
You can call a static method using (ClassName/methodName arguments)
.
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
.
Solution 2:
An example is worth 100 words:
(. String (valueOf 1))