user4813927
user4813927

Reputation:

Calling java in clojure

If i want to call java methodes or fields in clojure i can use the dot special form, since clojure strings are implemented as java strings i think i should be able to call the String methodes of java by something like (.toUpperCase "clojure") which works. My question is why can i not access to all of the java Methods in the same manner? For example (.valueOf 3) which is this static method gives me an error.

Upvotes: 0

Views: 107

Answers (1)

cfrick
cfrick

Reputation: 37008

Is's a static method, so also in java you would call String.valueOf(3):

user=> (String/valueOf 3)
"3"

Upvotes: 2

Related Questions