title: How to test if an object is primitive type or an array of primitive type in Java?
body: <p>Here the function signature I would like to implement.</p>
  
  <pre><code>public boolean isBaseTypeOrArray(Object obj){~}
  </code></pre>
  
  <p>I want to return true only if obj is of one of the following types.</p>
  
  <pre><code>boolean or boolean[]
  byte or byte[]
  short or short[]
  int or int[]
  long or long[]
  float or float[]
  double or double[]
  char or char[]
  java.lang.String or String[]
  </code></pre>
  
  <p>For a lone value checking if it is instance of one of the wrapper classes (Integer, Float, ...) or String should work because of auto boxing but I do not know how to check for the array case. Any ideas?</p>