Browse Clojure Foundations for Java Developers

Data Type Conversion Between Java and Clojure

Convert collections, null/nil, numbers, arrays, and common Java types at the boundary.

Interop usually fails (or becomes ugly) at the type boundary: null vs nil, Java arrays vs Clojure sequences, mutable collections vs persistent data.

A practical rule for Java engineers:

Convert once, at the edge. Keep the inside of your program on one side of the boundary.

Common conversions you will see:

  • Java collections ↔ Clojure maps/vectors (into, seq, vec)
  • arrays ↔ seqs (into-array)
  • nullnil (be explicit and defensive)

This section helps you build consistent conventions so interop code stays predictable and reviewable.

In this section

Revised on Friday, April 24, 2026