(rontolisp) docs
← Java interop

new

(new Class args...)

Constructs a host object; the (Class. args) suffix spelling and (Class/new args) (Class/member) are the same operation. The instance answers to every other interop verb. Runs on the interpreter and the JVM only -- the wasm backends reject java:. Three constructions build a stream instead, on every backend: a zero-argument java.io.StringWriter (see with-out-str), and a java.io.PushbackReader or java.io.BufferedReader over a stream (a clojure.java.io/reader, *in*), which is that stream, or over a java.io.StringReader construction, which is a string reader -- what read reads. A throwable class that carries only a message and a cause (Exception, IllegalArgumentException, java.io.IOException, ...) constructs an exception (see throw), on every backend too.