[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 Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s