Java provides a superclass and interface mechanism to provide encapsulation and extendibility. Let's have a look at how to extend existing Java superclasses and implement Java interfaces in Clojure.
In this chapter, we will learn how to define subclasses and how to implement superinterfaces. We will use Jackson and other libraries. So, the :dependencies
section in your project.clj
as follows:
:dependencies [[org.clojure/clojure "1.8.0"] [org.clojure/math.numeric-tower "0.0.4"] [com.fasterxml.jackson.core/jackson-core "2.7.0"] [com.fasterxml.jackson.core/jackson-databind "2.7.0"] [com.fasterxml.jackson.core/jackson-annotations "2.7.0"] ]