[Clojure] – Could I use Java functions with it ?

Yes, it is possible. In this case we use a point before the function to invoke it.

Look below :

Screen Shot 2016-06-21 at 10.39.36 PM.png

Console :

Screen Shot 2016-06-21 at 10.39.41 PM

In this case we are invoking contains function that exists in the String class in Java. As Clojure runs on the JVM, we can make use of existing methods there. In Java, this code would look something like word.contains (word2).

 

Leave a comment