Browse Clojure Foundations for Java Developers

Data Types

The core literal types in Clojure and what they map to on the JVM.

Java developers already think in terms of types, but Clojure changes where “type work” happens. You still run on the JVM and you still have Java classes under the hood—but most of the time you let values and operations drive your design, and you reach for explicit types only when interoperability or performance demands it.

This section focuses on the small set of core literal types you’ll see everywhere: numbers, strings, characters, booleans, nil, and a few JVM-backed variants like ratios and big numbers.

Java mental model: Clojure is dynamically typed, but it’s not “typeless”—values have concrete JVM classes, and you can always inspect them at the REPL.

What to pay attention to

  • Truthiness: only false and nil are falsy. Everything else is truthy.
  • nil vs null: nil is the idiomatic “no value” in Clojure, but Java APIs may still return/accept null—interop code should be defensive.
  • Numbers: the “numeric tower” is real. You’ll see 1 (Long), 1N (BigInt), 1M (BigDecimal), and ratios like 1/3.
1(class 1)    ;; => java.lang.Long
2(class 1N)   ;; => clojure.lang.BigInt
3(class 1/3)  ;; => clojure.lang.Ratio

As a Java engineer, the main skill here is learning which details matter for day-to-day code (truthiness, nil, numeric literals) and which details can be deferred until you hit an interop boundary.

In this section

Revised on Friday, April 24, 2026