title: Passing a 2D array of Integers into Java from Clojure
body: <p>In my Java library I have a function </p>
  
  <pre><code>void f(Integer[][] grid) {
  </code></pre>
  
  <p>and I want to call it from Clojure </p>
  
  <pre><code>(f (to-array-2d
         [[1 0 0 0 1 0 0 0 1 0 1 0 1 0 0 1]
         [0 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0]]) )
  </code></pre>
  
  <p>The problem is, that the Clojure seems to be putting the data into generic Object class. While my functions wants Integers</p>
  
  <p>Error message :</p>
  
  <blockquote>
    <p>actual: java.lang.ClassCastException: class [[Ljava.lang.Object;
    cannot be cast to class [[Ljava.lang.Integer; ([[Ljava.lang.Object;
    and [[Ljava.lang.Integer; are in module java.base of loader
    'bootstrap')</p>
  </blockquote>
  
  <p>How can I tell Clojure to put these into Integers? Or do I have to write my Java using Object?</p>