Chapter 16Interoperating with Java

So far our exploration of Clojure has been exactly that: an exploration of Clojure. But one of the best things about Clojure—at least Clojure on the JVM—is that it’s part of the Java ecosystem. And that means that Clojure programmers can take advantage of the mountain of Java code that has been written in the past couple of decades.

But to get at all that Java code you need to know two things. First, you need to have at least a general understanding of how Java works. Second, you need to know how to call Java code from your Clojure program. So these are the two topics we’ll explore in this chapter. In the pages that follow we’ll discover how in Java we use classes to make objects, and objects to make things ...

Get Getting Clojure now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.