How can I call a java static method in clojure?

后端 未结 4 1303
耶瑟儿~
耶瑟儿~ 2020-12-05 17:27

I wish to call class on the String class. How can I access this static method?

4条回答
  •  佛祖请我去吃肉
    2020-12-05 17:58

    Your question has been answered, I think, but if you really do want to get the class of an unknown object, you can use the class function:

    > (class "Foo")
    java.lang.String
    

    As in java, to specify classes outside of java.lang as literals, you need to either import them, or specify the full package + class name using dot (.) separators.

提交回复
热议问题