简体   繁体   中英

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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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