0Pricing
Clojure Functional Programming & JVM Backend Development · Lesson

Working with Java Collections and Arrays

Interop often means crossing between Clojure's immutable collections and Java's mutable ones. This lesson teaches converting, iterating, and handling primitive arrays from Clojure.

Two Collection Worlds

Clojure collections are immutable and persistent; Java collections are typically mutable. Interop requires moving values between them carefully.

Java Collections Are Seqable

Most Java collections implement Iterable, so Clojure's seq functions work on them directly.

(def jlist (java.util.ArrayList. [1 2 3]))
(println (map inc jlist))

All lessons in this course

  1. Calling Java from Clojure
  2. Implementing Java Interfaces
  3. Leveraging Java Libraries & Tools
  4. Working with Java Collections and Arrays
← Back to Clojure Functional Programming & JVM Backend Development